In some cases, you want to capture http header information into a custom field. Here’s an example to save the referring URL.

If embedded this will be the URL of the landing page where the Decision Tree is embedded.

Say you have 3 URL’s with one Decision Tree. In this case you would have the need to determine which URL was accessed.

This can be accomplished with some JavaScript

  1. First create a text custom field. We can call this ‘referrer’

2. Next add this code to the first node of the Decision Tree. It should fire on enter of the 1st node.

<script>
var x = document.referrer;
console.log(x);
DT.setField('referrer', x);
</script>

3. Now you can print the custom field like so: {referrer}

Leave a Reply

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