User Has Seen A Url Parameter

Aug 21, 2017

Below is an example of an Adobe Target Profile Script that records if a visitor has had a particular parameter in the url. It is based off of matching against the url parameters and could re-purposed for any url parameter.

This script checks to see if the visitor’s url matches the parameter campaign=summer. If they have, it stores in the profile script summerCampaign a value of 1, indicating that the user saw that parameter in the url. This is stored and can be used and referenced on other subsequent pages.

if (page.query.indexOf('campaign=summer') > -1) {
return 1;
}else{
if (!user.get('summerCampaign')) {
return 0;
}
}

The else statement is just a best practice to set all other users to 0, indicating that they have not seen the url parameter.

The name of this profile script would be summerCampaign. Notice that within the profile script, the script can reference itself. In this case it checks to see if summerCampaign is already set so that it doesn’t overwrite itself if the user saw the parameter on an earlier page.

From $0 to Independent
Learn to grow a business from the ground up.
Get the Newsletter






Most Recent

  1. Create Adobe Target Audience From A Cookie
  2. Adobe Target Consultant
  3. Prioritize Your Theories
  4. Generate Theories
  5. What a 50 mile bike ride taught me Energy and Efficiency
  6. Perpetual Optimization Process
  7. How to Clear Adobe Target Previews
  8. Stop Using Profile Scripts
  9. Exit Pops that Generate Revenue
  10. Adobe Target Premium Training

Before You Go!

Tell me one thing that you would like to learn more about. I'll write about it and email you when I'm done.

Email Address (Optional but recommended)