Skip to content

Instantly share code, notes, and snippets.

@coderberry
Last active August 27, 2018 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderberry/eddf80caf38be2707de5c5e5ff94ecd1 to your computer and use it in GitHub Desktop.
Save coderberry/eddf80caf38be2707de5c5e5ff94ecd1 to your computer and use it in GitHub Desktop.
Server-to-server API ads via CodeFund

CodeFund can provide ethical advertising without having to use JavaScript.

The flow looks like this:

  1. Ping the API for an available ad. The request should contain the browser width and height. For example:

    curl 'https://codefund.io/t/s/[YOUR_PROPERTY_ID]/details.json?ip=[IPV4]&width=1750&height=825'

The API will respond with the ad details:

{
  "small_image_url":"https://d2nhukomolqgak.cloudfront.net/ce2c0f1f-dae7-4c2a-8233-759bd75d1c4f_rollbar-100x100.png",
  "poweredByLink":"https://codefund.io?utm_content=8b15c523-cdb5-468d-8daf-243ca12977d6",
  "pixel":"//codefund.io/p/90fb691c-f199-4a99-bb03-b4bb1315209c/pixel.png",
  "link":"https://codefund.io/c/90fb691c-f199-4a99-bb03-b4bb1315209c",
  "large_image_url":"https://d2nhukomolqgak.cloudfront.net/6f8a74dd-f990-49aa-89b6-7f36fb9d0f83_rollbar-130x100.png",
  "image":"https://s3.us-west-2.amazonaws.com/codefund.io/prod/6f8a74dd-f990-49aa-89b6-7f36fb9d0f83_rollbar-130x100.png",
  "headline":"Rollbar",
  "description":"Real-time error monitoring, alerting, and analytics for JavaScript developers 🚀"
}

It is required to place a pixel image on the page with the pixel url provided in the response. This will update CodeFund with the browser information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment