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

Get an attribute from JSON and pass to Target (at.js)?

Avatar

Avatar
Validate 1
Level 1
jenPump
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
jenPump
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
jenPump
Level 1

20-07-2017

We have an authenticated page that returns a json with the different types of accounts a client has with us.  I want to use Target to present an offer based on the account type.  Is there a way to make Target to be aware of the values returned in this json file?  I'd prefer not to use Customer Attributes.  Will profile scripts work? We are brand new on Target Standard using at.js.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
netxpressd44426
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
netxpressd44426
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
netxpressd44426
Level 1

24-07-2017

Depending on your implementation of Target you can create a JavaScript function to send data to be processed in profile scripts.

function targetPageParams() {

     That function returns URL style parameters that will be automatically added to the parameters that are already sent (Eg. screenWidth, screenHeight, colorDepth etc.) to the Adobe cloud.

     Eg. &pr.channel=education&pr.level=university

     I have name spaced the parameters so I don't get clashes with whatever Adobe sends.

     The profile scripts are short JavaScript programs that should return strings or numbers which then Audiences can use to determine if the customer belongs.

     Eg.

var testChan = mbox.param('pr.channel');

var testLevel = mbox.param('pr.level');

if (testChan) {

  if (testChan === 'education') {

    if (testLevel) {

      if (testLevel === 'high') {

        return 'highschool';

      } else if (testLevel === 'university') {

       return 'university';

      } else {

        return 'education';

     }

   } else {

     return 'education';

   }

} else {

  return 'unknown';

}

Answers (0)