Profile Scripts + Visitor Profiles

Avatar

Avatar
Validate 10
Level 4
bkmills1
Level 4

Likes

43 likes

Total Posts

54 posts

Correct reply

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

Avatar
Validate 10
Level 4
bkmills1
Level 4

Likes

43 likes

Total Posts

54 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
bkmills1
Level 4

13-03-2018

Hello,

Our dev team encountered an issue recently where an audience we created to track the number of days from the current day has stopped working. For example, if I chose to book at trip for 3/23, I'd be counting 10 days from today, and would subsequently be placed within a 0 - 10 audience segment. However, we have several audiences that utilize this profile script, that are now grossly under-reporting data.

As mentioned, the following script has worked for months, and suddenly has stopped. When I put it in Console, I get an "Illegal return statement" error message.

While I didn't write this, can anyone tell if there's a problem with this script, or determine if something larger is the issue?

//Grab the check-in day and month

var taoCheckInDay = page.param('qCiD'),

     taoCheckInMonth = page.param('qCiMy');

// Change check-in month and day into a Date object

var taoCheckInYear = taoCheckInMonth.substring(2, 6); // Creates something like 2016

var taoCheckInMonth = taoCheckInMonth.substring(0, 2); // Should now just be 00 through 11

var taoCheckInDate = new Date(taoCheckInYear, taoCheckInMonth, taoCheckInDay);

var taoToday = new Date();

// Take those dates and determine how far away is the check-in date

return Math.round((taoCheckInDate - taoToday) / (1000 * 60 * 60 * 24));

Thanks,

Brion

Replies

Avatar

Avatar
Boost 1
Level 1
crodeveloper
Level 1

Like

1 like

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
crodeveloper
Level 1

Like

1 like

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
crodeveloper
Level 1

13-09-2018

The profile Script code won't execute in the console. Either use mboxtrace method or activate the campaign with some QA audience.

Avatar

Avatar
Boost 5
Level 4
pranavkaushik
Level 4

Likes

39 likes

Total Posts

37 posts

Correct reply

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

Avatar
Boost 5
Level 4
pranavkaushik
Level 4

Likes

39 likes

Total Posts

37 posts

Correct reply

13 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
pranavkaushik
Level 4

13-09-2018

Hi,

Profile scripts run server side and hence in the console you will never be able to execute.

You can debug profile script through response tokens or through mbox Trace.

Detail you can find at below supporting doc under Debug Profile Script:

Profile Attributes

Hope this helps.

Thanks

Pranav

Avatar

Avatar
Give Back 5
Level 3
skandg43264764
Level 3

Likes

31 likes

Total Posts

38 posts

Correct reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Level 3
skandg43264764
Level 3

Likes

31 likes

Total Posts

38 posts

Correct reply

7 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
skandg43264764
Level 3

20-09-2018

You can even display the profile scripts value in console but only from your offer code implemented through the Activity.

Just use the below syntax in your offer code :

<script>

  var ProfileScript = '${user.profilescriptname}';

  console.log('profile script:',ProfileScript );

</script>

Note : write your own profile script name