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

Profile script: Has seen pages?

Avatar

Avatar
Validate 10
Level 2
chrisw78940856
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
chrisw78940856
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
chrisw78940856
Level 2

15-03-2017

Hi,

I'm hoping to set up a profile script to create a user parameter which tells me whether or not the user has viewed a certain set of pages before. This must be across sessions.

At the moment I have this for my script called 'LastContentPage: 

if(!user.get("LastContentPage")){
  if(mbox.name==="target-global-mbox" && page.url.includes("contentpage")){
    return 'Content Page';
}

The script is referring to the global mbox to grab a page URL. If that URL contains 'contentpage', then a parameter is passed to the user. I'd then set up a rule saying 'If this user parameter equals "Content Page", apply offer'.

Will this work? How can I test it without applying it directly to an activity?

Thanks,

Chris

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

15-03-2017

Hi Chris,

I'm not sure about the 'include' method, don't know if that exists. The following would work, and since you just want to set a flag if the user sees a URL containing a certain value, I would use something like this:

if (mbox.url.indexOf("contentpage") == -1) {
    return "Content Page"
}

In order to test it, I would setup a 'test experiment' where you do a combination, where both the profile need to match and you need a specific value in a query string. When I test for clients I do it that way, to avoid making customer facing changes.
I'm not sure if the profile will be visible in your audience builder as soon as you create the profile, or if it first appears when it has some data... In case it first appears when you have data, that could also be a way of testing it...

As an alternative, setup a test with your new audience, on a page where you make no changes and then deploy it for a short time to see if any data comes in.

/Løjmann

Lead Solution Architect
eCapacity.com

Answers (0)