Townsend Tech Tools
How to dynamically insert an affiliate ID into a banner
Lorand Minyo from Romania sent me this question:
“I have a campaign running on multiple sites with different publishers, with two banners in rotation. These publishers run the invocation code on their sites and I use Revolver Ad Project to count views and clicks. However, I’d like to give each of the publishers the ability to have a different link for the same banner – for example publisher 1 using banner X and have the link myurl.com?affid=1, publisher 2 using the same banner X and have the link myurl.com?affid=2 and so on. This would be particularly useful since I want to count views and clicks in Revolver Ad Project and record transactions in my billing system. So my question is: Can you have different links for the same banner or different links for different zones?”
Lorand, this is possible, and it is not even all that hard to implement. I suggest we use two techniques that are not very well known: site variables in zone invocation code and magic macros in banners. I will explain it below.
Adding publisher details to Revolver Ad Project invocation code When Revolver Ad Project generates the invocation code for a zone, one line of that code contains the ID of the zone in question:
What many people don’t know is that you can add extra parameters to the line of where Revolver Ad Project placed the zone ID. Here is an example that could be used for the scenario that Lorand described:
Just send each publisher instructions to replace the capital X with the number that you want them to use so that you can uniquely identify them. Any time Revolver Ad Project is processing an ad request for this zone, it ‘knows’ the extra bit of information, in this case, the value of the variable named “pubid”.
Dynamically altering a banner or link Now that we have the publisher’s ID in Revolver Ad Project during ad processing, we need a way to insert this ID into the banner. There is a little known feature in Revolver Ad Project called “Magic Macros” that can do just this.
Let’s assume you have a banner in Revolver Ad Project (it might be an image banner with a destination URL specified, but it could just as well be an HTML banner). The link would like something like this:
What Magic Macros can do is simple, let me give you the example and you’ll see right away:
Whenever a banner with this magic macro is delivered through a zone that’s called with the special version of the invocation code described above, Revolver Ad Project will automatically replace the magic macro with the value of the pubid variable. So if the zone is called like this:
The banner will be delivered with this link:
Powered by BetterDocs
Business name :
EMail * :
Name * :
Your position :
Phone * :
Company size : 1-55-2020-5050-250
Facebook Business Page :
I agree with terms and conditions * :
By using this form you agree with the storage and handling of your data by this website. * :