Frequently asked questions Custom Code

How do I transfer UTM parameters to another page?

How do I transfer UTM parameters to another page?

Examples below require knowledge of Javascript and CSS. Tilda Customer Support does not assist in code-related questions.


Here is a way to transfer UTM parameters attributed to a visitor, to any internal link on this page (no external links):


<script>
var links = document.getElementsByTagName('a');
Array.prototype.forEach.call(links, function (link) {
if ( link.href.indexOf("roman.ws") > 0 && link.href.indexOf("#") < 0 ) {
link.href += location.search;
}
});
</script>


Replace "roman.ws" with your domain name.

Insert the code in the block T123 (Embed HTML Code) from the "Other" category.

Learn more about embedding HTML code in our guide: http://help.tilda.ws/html.

Please note that we do not assist in implementing a third-party code.

Was this answer helpful?
Yes
0
No
0
Views: 480