Can I pass data to my affiliate links or autoresponder?
This article describes an older, less flexible approach to passing sub-IDs through funnel pages. It is here only for reference by people who are still using any of the
variants. For the most up-to-date approach, read this article:
You betcha—you just need to use a little magick.
section of the page and replace them with the corresponding
query string values passed to the page.
This lets you set values in links and hidden form fields without actually knowing what those values will be ahead of time. Just insert the tokens as placeholders and the magick will happen.
Query strings are a pretty important part of passing data to affiliate links, so if you don’t know what a query string is and how you pass data using them, you should study the following article until you feel totally comfortable with the topic:
Finally, for each page that you want to pass data through, simply follow these steps:
</body> tag as possible.
<body> tag, the code will run before any of the HTML coming after it has loaded and therefore won’t update any
[s1] tokens in your HTML that you want to have replaced. The easiest way to ensure that the code will do what you expect is to simply insert it at the very end of your page, right before the
||The next step is to use the Sub-ID tokens
[s5] in the
<body> section of your page wherever you want the corresponding
s5 query string values to be inserted.
For example, if you want to add the value of the
s1 query string parameter to the end of your ClickBank affiliate link, you’d do it like this:
If you want to pass any of the
s5 query string values to a ClickMagick tracking link on the page, simply insert the tokens as Sub-IDs for the link:
Caution: You cannot use the
[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. For more information, see the caution at the end of this page.
[s5] tokens won’t work between
</script> tags. If you need to use any of the
qsubids.s2 etc. to “build” the URL.
window.open("https://www.site.com?s1=[s1]&s2=[s2]"); // Incorrect
... which won’t work, you would need to code it this way:
window.open("https://www.site.com?s1=" + qsubids.s1 + "&s2=" + qsubids.s2);
window.open("https://www.clkmg.com/[USERNAME]/somelink/[s1]/[s2]"); // Incorrect
... which also won’t work. Instead, you would have to code it like this:
window.open("https://www.clkmg.com/[USERNAME]/somelink/" + qsubids.s1 + "/" + qsubids.s2);
||Once you have your page set up, you can link to it by passing your Sub-ID values to your page by adding a query string to your 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 need to pass Sub-IDs to multiple pages through a funnel, just repeat this process for every applicable page and then chain them all together.
Just remember that if you’re chaining two pages together through a tracking link rather than by a direct link, the Primary URL of the tracking link should pass on the Sub-ID values it gets by using the same
Passing Data to your Autoresponder
To pass one or more Sub-IDs (including the click ID) through an email opt-in form, the best way is to pass the value through the Thank You page URL in the HTML generated by your autoresponder form editor.
Most autoresponders today have editors where you can design the opt-in form for your email opt-in page.
As you edit your form, look for a “Thank You” page setting or “Success” page URL setting and point it to the next page in your funnel.
For instance, suppose your HTML looks something like this:
<input type="hidden" name="thankyou_url" value="https://www.site.com/thankyou.html">
Here you see a “hidden” URL with “thankyou” in the name and a value that points to the Thank You page you specified when you created the form.
To pass your Sub-ID, you simply need to add the
tokens to the Thank You page URL. So, if you were passing the click ID through the
query string variable, you would create (or add) the
variable to the URL:
<input type="hidden" name="thankyou_url" value="https://www.site.com/thankyou.html?s1=[s1]">
, this will take the
value that was passed to your opt-in page, and pass it right along to your Thank You page after the visitor’s email address has been captured.
The “[” and “]” characters are not allowed in URLs, so some autoresponders won’t let you directly enter the
What if there isn’t a Thank You page URL?
[s5] tokens in the Thank You page URLs of their forms. If you run into this restriction, simply enter a fake URL for the Thank You page URL, then once you generate the autoresponder HTML for the form, simply replace the fake URL in the HTML code with the actual Thank You page URL that contains the
If you can’t immediately find help for passing “custom values”, contact your autoresponder service for help with this. Remember, they know their system inside out and they are the experts for their system, not us …
Generally speaking, if you can’t modify the Thank You page URL, you’ll instead have to pass custom values in hidden data fields like this:
<input type="hidden" name="custom1" value="[s1]">
<input type="hidden" name="custom2" value="[s2]">
Once you’ve done this, you can then pass the custom values on to your Thank You page URL using whatever tokens your autoresponder system supports. You’ll need to set that part up inside your autoresponder settings.
If you need help configuring your autoresponder to pass custom values, contact the support folks for your autoresponder for help with this.
Caution: Modifying the
</head> section of your page is unpredictable, which means you can’t use the
[s5] tokens anywhere in your page header. It is especially important to remember that you cannot use these tokens in a “meta refresh” tag and expect them to work.
// This meta refresh will not work reliably...
<meta http-equiv="refresh" content="3; url=https://mylink.com?s1=[s1]">
The need for a “meta refresh” usually comes up when you’re trying to create an intermediate or interstitial page to fire a tracking pixel. ClickMagick has a more effective approach using the advanced Pixels setting
of tracking links. You can get all the details in this article:
Article 399 Last updated: 04/25/2020 11:37:49 AM