Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Create an audience containing visitors who visits a URL containing a certain parameter

Avatar

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
miguelm62125791
Level 1

21-03-2017

Hi!

I want to create an Audience containing visitors who visit a URL which contains a certain parameter, and once visitors visit that URL, I want them to be a part of that audience, and not just when they are on that URL but even when they browse out of it.

How can I do this? I try to do it using a "Site page" rule, but the only rules are "Landing page," "Previous page", or "Current page", and what I need is "If the page has ever been".

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Løjmann
Level 4

21-03-2017

Hi,

in that case, you would benefit from doing a Profile Script, setting a flag in the users target profile, when a page is visits that meet your criteria.

The script below, looks for the query-string parameter 'cid' and if it exists, then the value of cid are set in the profile (named, what every you name the profile script)

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

This script simply just take the value of cid and store that in the profile, if a new cid-query are set then the value are overwritten.

The following script will stack (add, comma separated list) and remove duplicated values:

// Better stacking via user-profile (no duplicates)
try{
    var mboxParam = page.param('cid').toLowerCase() || ""; if (mboxParam != "") {
        if(user.get('custcmp')) {
            if (user.get('custcmp').indexOf(mboxParam) != -1) {
                mboxParam = user.get('custcmp');
            }
            else {
                mboxParam = user.get('custcmp') + ',' + mboxParam;
            }        
        }
        return mboxParam;
    }
}
catch(e){
    // Error handling...    
}

Hope this helps?

/Løjmann

Thomas Løjmann Jørgensen
Lead Solution Architect - Adobe Marketing Cloud
www.ecapacity.com

Answers (7)

Answers (7)

Avatar

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
miguelm62125791
Level 1

28-03-2017

Thank you Thomas,

Yes, the code is working, I had forgotten activate the profile script. 🙂

Avatar

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Løjmann
Level 4

22-03-2017

Hi,

I would say that it should work. Are the profile script activated? Another thing could be casing, if the query are Referidos and the script are looking for referidos, then it won't work...

/Løjmann

Avatar

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
miguelm62125791
Level 1

22-03-2017

Hi Thomas,

I have created the Profile Script using the following code:

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

after that, I have created the following Audience:

user.Referidos equals s

 

however seems that the test is not being activated, Please could you tell me what I am doing wrong?

Thank  you

Avatar

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Løjmann
Level 4

21-03-2017

Hi,

No, you would need to add the full code. I would wrap it in a try-catch, to avoid errors (even so the code are running server-side)

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

Then the profile parameter are only set, if the querystring referidos exists, and it get's the value of the query string (value = 's', in your example URL)

/Løjmann

Avatar

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
miguelm62125791
Level 1

21-03-2017

Thank you for your answer Thomas,

 

so if I understand well, I only need to add the following code inside the profile script:

                            page.param(‘referidos’) == s

Thank you. 

PS: We are using the following parameter www.oururl.com?referidos=s

Avatar

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
Løjmann
Level 4

Likes

35 likes

Total Posts

117 posts

Correct Reply

42 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Løjmann
Level 4

21-03-2017

Hi,

You would create them under Segments -> Profiles in Target, see more here :https://marketing.adobe.com/resources/help/en_US/tnt/help/c_Using_Script_Profile_Parameters.html

/Løjmann

Avatar

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
miguelm62125791
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
miguelm62125791
Level 1

21-03-2017

Hi Thomas,

Thank you for your answer. What I need is even simpler, in the activity I want to include, all the visitors who at any moment, visit a page which contains this parameter: ?referidos=s  

How can I do this? From your answer I guess that I need to create a profile script, but I don't know how to do it

 

Thank you

 

 var mboxParam = page.param('referidos').toLowerCase() || ""; if (mboxParam != "") {
        return mboxParam;
    }