Expand my Community achievements bar.

SOLVED

Creating Audiences Based on user.endpoint.lastViewedEntity

Avatar

Level 2

Hello!

I'm looking for some guidance on creating audiences using the user.endpoint.lastViewedEntity attribute in Adobe Target.

I want to create two separate audience segments:

  1. Visitors with Data:

    • Criteria: Users whose user.endpoint.lastViewedEntity contains "text".
    • Recommendations:
      • Audience: Visitors with Data.
      • Criteria: Combination of "Most Recently Visited" for pages they have visited, and fallback to "Most Viewed Pages" for others.
      • Design: Headline should read "Recommended for you". Display the printers first by most recently visited pages, then by most viewed pages for unvisited printers.
  2. Visitors without Data:

    • Criteria: Users whose user.endpoint.lastViewedEntity doesn't contain "text".
    • Recommendations:
      • Audience: Visitors without Data.
      • Criteria: Use the "Most Viewed Pages" criteria.
      • Design: Change the headline to "Top picks" and display the printers in the order of the most viewed pages.

My Question: How can I create these two audience segments based on the user.endpoint.lastViewedEntity attribute?

Any help would be greatly appreciated!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Did a bit more digging - you can actually access user.endpoint.lastViewedEntity (including all historical last viewed entities) via profile script. So a simple example would be:

var lastViewedEntity= user.get('endpoint.lastViewedEntity')+"";
if(lastViewedEntity != 'null'){
  return lastViewedEntity;
}

 

View solution in original post

4 Replies

Avatar

Employee Advisor

That user.endpoint.lastViewedEntity parameter isn't available "out of the box" in the audience creation workflow. However, you can access it quite easily via a Profile Script. 

If it's only the single most recent entity, your profile script could just be something like

var lastViewed = mbox.param("entity.id");
if (lastViewed) {
return lastViewed
}

And then if your profile script is named "returnLastViewed", for example, your Audience definition would then be
Skærmbillede 2024-05-10 kl. 15.31.38.png 

If you want to look beyond just the very last entity viewed, you could develop the profile script further e.g., each time the entity.id param exists, append the ID to a comma-separated string. 

Avatar

Level 2

I don't need only the last entity or the entities captured from now into the future; I need all historical last viewed entities as they are in user.endpoint.lastViewedEntity.

Based on your reply, I'm assuming it's not possible?


Thank you!

Avatar

Correct answer by
Employee Advisor

Did a bit more digging - you can actually access user.endpoint.lastViewedEntity (including all historical last viewed entities) via profile script. So a simple example would be:

var lastViewedEntity= user.get('endpoint.lastViewedEntity')+"";
if(lastViewedEntity != 'null'){
  return lastViewedEntity;
}