Publishers can grow with CodeFund without sacrificing revenue

Eric Berry
Jan 17 · 2 min read

Original post found at

Building an ad platform can be tricky. Not only from a technical aspect but also regarding growth. It reminds me of the “which came first, the chicken or the egg” question.

Which came first, the chicken or the egg?

In our case, the chicken would be the publisher, and the egg would be the advertiser. Publishers attract more advertisers, and advertisers attract more publishers.

Last year we decided to invest in ourselves and play the part of the advertiser when paying ads ran out. These internally paid ad campaigns helped ensure that we had enough funds to draw in more publishers. As well as this worked, it ended up costing us all of our profits. Did it work? Yes. Was it sustainable? Hell no.

In 2019, we decided to stop paying publishers to place fallback ads. This decision will allow us to realize a profit, which of course makes it so we can be around for the foreseeable future. However, this may come at a cost to some of our larger publishers because they may be displaying unpaid fallback ads.

Ad Callbacks

To resolve this concern, we have recently added callbacks into our funder script that can be subscribed to by the publisher.

Here’s the code that generates the funder script:

The lines to note here are 3, 11, 14, 18 and 21. We trigger a new event called ‘codefund’ which contains the status of the embed. If the status is ‘ok,’ then we know that an ad rendered successfully. If the status is ‘no-advertiser,’ we couldn’t find an advertiser for the given property and visitor.

So let’s say one of our publishers wants to use CodeFund as the first option for ads (this happens a lot because we pay publishers higher rates). Now they can put in place an event listener that will render an ad from another network if there are no paying CodeFund ads.

Here’s an example:

Now that this change is in place, our publishers can grow with us without sacrificing their revenue.

To learn more, view our documentation at

If you are interested in being a publisher with CodeFund, or advertising to our fantastic network of developers, visit


We help sustain open source through ethical advertising

Thanks to Nathan Hopkins

Eric Berry

Written by

Founder of CodeFund / Co-Founder of Gitcoin



We help sustain open source through ethical advertising

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade