In this tutorial, you will learn how to use dynamic page variable fallbacks.
Generally, this would only be needed when you are using AEvent to capture additional fields on registration and you are using our dynamic page variables on either your confirmation page, your replay page, or any other page containing one of our header scripts.
Below we have two examples; the first one, we are capturing an affiliate ID from the registration form, and we are then utilizing that affiliate ID for an affiliate attribution on the confirmation page.
In the second example we are asking the registrant their age, then we using that dynamic variable on the replay page.
Example 1:
In this example, we use the query URL (to capture affiliate ID), then repopulate that value on your confirmation page.
If the lead doesn't have an affiliate ID attributed to them, we want to use our default affiliate ID.
To create the registration field, select query, and name it the exact same value that appears in the address URL of your registration page.
(need help setting up the registration field capture? Click Here for a tutorial)
Once created, click on Code, then select Confirmation Page, and scroll down to Dynamic Page Elements.
We can see in our example below, the value {!subscriber-affiliateid} exists. We need to copy this value to our notepad and edit it.
Below we can see what we initially copied out of our Dynamic Code variables and intro notepad is {!subscriber-affiliateid}.
By adding |aevent, we've now set it so that if the attribute affiliateid is empty/blank, our header scripts will implement it using the fallback affiliate id 'aevent' in this example.
The key to this implementation is the | value immediately follows the fallback value you want to be used if the attribute is empty.
In our example, we would use this value and our affiliate software JavaScript callback script. (If another script relies on AEvent dependencies, it is imperative that the AEvent header script is loaded in the header, with the dependency script in the footer of your page.
Example 2:
In our second example, we're asking the lead their age within our registration form, then using Dynamic Page elements, we're populating that value on our replay page.
To create the registration field, select custom form, and name it the same value that appears in the address URL of your registration page.
Once created, click Code, select Replay Page, and scroll down to Dynamic Page Elements.
โ
Below we can see what we initially copied out of our Dynamic Code variables and intro notepad is {!subscriber-age}.
By adding |ageless we've now set it so that if the wasn't required/selected on registration, and the value is empty/blank, our header script will implement using the fallback affiliate id 'ageless' in this example.
The key to this implementation is the | value immediately follows the fallback value you want to be used if the attribute is empty.
In our example, we can use this value on our replay page or our call to action page by including either the replay header script from our timeline or the audience pixel script. Anywhere we use the value, {!subscriber-age|ageless} on our page, the AEvent header script will change that value with the age of the lead, Or if AEvent doesn't have the value, we will populate that area with ageless.