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".
Solved! Go to Solution.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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;
}
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Hi Thomas,
How to build the below audience in Adobe target:
1. To check if the user is coming from mobile
2. To check is he is accessing XYZ URL
3. And the user limit crosses 500
Views
Replies
Total Likes
Thank you Thomas,
Yes, the code is working, I had forgotten activate the profile script. :-)
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies
Views
Like
Replies