<code><script>

Get all the URL values into a custom defined variable.

var url=document.querySelectorAll(“a”);

Use a loop to read all the URL values.

for(i=0;i<url.length;i++) {

Save all href attributes in a variable
var Sample_varible = url[i].href;

Search for a unique href values containing specific string values
if(Sample_varible.includes(“usmanfarooq.com”))

{

Overwrite URL values with new values
url[i].href = Sample_varible + “{{custom paramter details for tracking}}” ;

};

</script></code>

Feel free to get in touch If there is an issue implementing the code. You can email at me@usmanfarooq.com

Leave a comment

Your email address will not be published. Required fields are marked *