Introduction:
This guide provides a process for storing your third-party tracking and sub-IDs into LeadsHook custom fields. By the end, you’ll understand how to save these IDs and how to store your exit URL along with custom fields to pass it to your Email Service Provider (ESP).
Important: DT.setField function cannot be used on the last node for V2 DTs.
<script>
DT.setField('custom_field', 'Custom Field Value');
DT.setField('city', 'New York');
DT.setField('amount', 10000);
</script>
Storing your Exit URL along with the custom fields and pass it to your ESP.
Step-by-Step Instructions:
You will need to use Javascript for this. Basically add it on the node before your results node and set it to Exit or Enter.
Step 1: You need to create a text type custom field to be the container for your exit URL.
Step 2: Paste this script on the node before you results node. Make sure to replace the custom fields to whatever custom fields you are trying to pass and also replace ‘URL’ to the custom field you created in step 1.
var myURL = 'www.domain.com/?customfield1={customfield1}&customfield2={customfield2}';
DT.setField('URL',myURL);
Pro Tips:
- Always test your scripts to make sure they’re functioning correctly.
- Be cautious when editing scripts. Even a small syntax error can cause them to malfunction.
Troubleshooting:
- If the script isn’t working as intended, double-check the syntax and make sure the correct custom field names are used.
Conclusion:
Storing third-party tracking and sub IDs into LeadsHook custom fields greatly simplifies tracking your decision trees. Follow these steps carefully to ensure that your tracking IDs and exit URL are properly stored and passed to your ESP.