Below is the piece of code that can be used to append the tracking template automatically:
<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 (var i = 0; i < url.length; i++) {
// Save all href attributes in a variable
var sample_variable = url[i].href;
// Search for unique href values containing specific string values
if (sample_variable.includes("usmanfarooq.com")) {
// Overwrite URL values with new values
url[i].href = sample_variable + "{{custom parameter details for tracking}}";
}
}
</script>
