Keep users with a URL parameter in an experience | Community
Skip to main content
Level 2
August 9, 2022
Solved

Keep users with a URL parameter in an experience

  • August 9, 2022
  • 1 reply
  • 823 views

Hi!

I am trying to set up an activity that does the following:

Upon entry to the site with a URL that contains this parameter  PST_V2, hide two pieces of content (was using display:none to do this) and persist hiding for rest of session

That URL parameter is only present on initial entry page, it falls off should a user navigate to another page.

 

I tried setting up a profile scriptlike so:

try{
var mboxParam = page.query('PST_V2') || "";
if (mboxParam != "") {
return mboxParam;
}
}
catch(e){
// Error handling...
}

and then set up an audience like this:

 

I am not having any luck. What am i doing wrong? Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by strrjms

If this helps anyone else....after a few more tries, i figured out what i was doing wrong.

My audience was fine, my profile script was keying off the wrong thing.

My url is formatted as such:
www.mysite.com?param_here=PST_V2

i was initially looking for just "PST_V2", when i really needed to use "param_here".

 

Updated profile script to this and I was back in business!

 

try{
var mboxParam = page.param('param_here').toLowerCase() || "";
if (mboxParam != "") {
return mboxParam;
}
}
catch(e){
// Error handling...
}

1 reply

strrjmsAuthorAccepted solution
Level 2
August 9, 2022

If this helps anyone else....after a few more tries, i figured out what i was doing wrong.

My audience was fine, my profile script was keying off the wrong thing.

My url is formatted as such:
www.mysite.com?param_here=PST_V2

i was initially looking for just "PST_V2", when i really needed to use "param_here".

 

Updated profile script to this and I was back in business!

 

try{
var mboxParam = page.param('param_here').toLowerCase() || "";
if (mboxParam != "") {
return mboxParam;
}
}
catch(e){
// Error handling...
}

Amelia_Waliany
Adobe Employee
Adobe Employee
November 30, 2022

@strrjms thank you so much for following up here with your Target Community peers with what worked well for you! 👏 Major kudos on identifying the issue - asking for help - trying again - and then, for taking the extra step to share your knowledge here - before getting right back to business! Keep up the amazing work!!⚡⚡