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):
By default cmtools.js only updates tokens in href, src, and value attributes of HTML tags.
Meaning, the code will not update any HTML attributes other than the ones mentioned.
However, the cmtools.js code does provide you with some flexibility in case your image links aren’t using the standard attributes.
First, if you declare the special cmtools_attrs array with one or more HTML attribute types, cmtools.js will make replacements in those fields as well. For example, if you wanted all your placeholder attributes updated, you would include cmtools_attrs array before you include the script:
var cmtools_attrs = ['placeholder'];
ClickFunnels uses the data-imagelink attribute if you make your images clickable.
So to make the change when adding the above code to ClickFunnels you would use:
<script> var cmtools_attrs = ['data-imagelink'];
Caution: You cannot use the [cm_s1] through [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.
Tip: For a detailed discussion on how the cmtools.js code actually works, read this: