How do I pass data to my affiliate network?
Sometimes you might want to pass more than just a click ID to your affiliate network.
) all the way from the first page of your funnel to the last page.
Because these Sub-ID values are stored in browser cookies, you only need to add the
code to the first and last pages of your funnel.
This article talks about “query strings” a lot. so if you’re a unsure about “query strings”, you should read the following article to get comfortable with them first:
Now here’s how you can pass Sub-ID values throughout your funnel:
||Once you have your pages set up, you can pass your Sub-ID values
cm_s5 to the first page of your funnel by adding a query string to the Primary URL of your tracking link like this:
All of the Sub-IDs are optional, so you can omit any
name=value pair or just leave the value blank for any Sub-ID you’re not using.
||If you want to pass the values from Page 1 of your website to Page 2, you’d pass them like this:
cmtools.js code you added to Page 1 will convert the
[cm_s5] tokens to their values before the link is used.
If you want to pass any of the
cm_s5 query string values to a ClickMagick tracking link on the page, simply insert the tokens as Sub-IDs for the link:
As an example, let’s assume you have a ClickBank affiliate link. If you want to add the value of the
cm_s1 query string parameter to the end of your ClickBank affiliate link in order to pass a click ID, you’d do it like this (assuming you passed the click ID in the Sub-ID 1 slot):
window.open("https://www.site.com?s1=[cm_s1]&s2=[cm_s2]"); // Incorrect
… you would need to code it this way:
window.open("https://www.site.com?s1=" + cmtools.s1 + "&s2=" + cmtools.s2);
window.open("https://www.clkmg.com/[USERNAME]/somelink/[cm_s1]/[cm_s2]"); // Incorrect
Instead, you would have to code it like this:
window.open("https://www.clkmg.com/[USERNAME]/somelink/" + cmtools.s1 + "/" + cmtools.s2);
Caution: You cannot use the
[cm_s5] tokens in the
<head> section of a page. Replacing text in the
<head> section is undefined behavior in HTML and does not work in all browsers.
That’s it! You should now be able to pass your Sub-ID values throughout your funnel, no matter how many pages it has.
Note: For this cookie approach to work, the page where the URL values are stored and the page where the Sub-ID tokens are replaced must be on the same web domain, which will be true in almost all cases.
Article 99 Last updated: 06/26/2020 12:27:50 PM
For a detailed discussion on how the
code actually works, read this: