Has this page been viewed before in current Session ?

Silver Contributor
Silver Contributor

Is there a utag variable which shows that this is the first time the page has been viewed for the current session?

Need to know this so that multiple refreshes of a page do not count towards a badge.

Thanks

William 

9 REPLIES 9

Has this page been viewed before in current Session ?

Moderator
Moderator
@william1 could you possibly give us some more information about the badge you're trying to set? This should be possible in AudienceStream alone by using a combination of attributes at the visit level and visitor level. If you can give more info about the badge assignment rules, it'll be easier to suggest the best solution.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Has this page been viewed before in current Session ?

Employee Emeritus

Hello @william1. This sounds more like an AudienceStream question, so I am moving this post to that board. Thank you. 

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.

Has this page been viewed before in current Session ?

Silver Contributor
Silver Contributor

So when a visitor views a page you score is incremented by 10. We want to ignore duplicate views of the same page from the last 24 hours.

For example:

1.view page example.com; the score is incremented by 10; the score is 10.
2.view page example.com within 24 hours of the last view; the score is kept at 10.
3.view page example.com after 24 hours from the last view; the score is incremented by 10; the score is 20.

Has this page been viewed before in current Session ?

Moderator
Moderator
@william1 within 24 hours is more tricky than "in current session" (by default, a session ends after 30 minutes of inactivity), but I think there is a way we can do it.

Do you need the score for each page on the site, or only for a specific page (or set of pages)? If you need it for named pages only, based on URL or page name, it will be a lot easier than making the rule dynamic for all pages.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Has this page been viewed before in current Session ?

Silver Contributor
Silver Contributor

Hi Craig,

For the PoC we could just use the current session to simplify the solution. We would need it for all pages with a specific tag.

Thanks

Has this page been viewed before in current Session ?

Tealium Employee

Hi @william1

It depends on whether you wish to do this for any number of pages separately (with separate scores), or whether it is a single page (or multiple pages, but a single rule) that contributes to the score. As you've also discussed, it depends on whether you want this based on the current session or on a longer timespan.

I will answer some of the possibilities and let you make the choice

Something to be aware of below is that the rule operator "has changed" is only true if that attribute has changed on the current event.

You may find this article useful if you have not seen the diagram before;

https://community.tealiumiq.com/t5/Universal-Data-Hub/AudienceStream-Visit-and-Visitor-Attributes-an...

In all cases below, I am using the query string on the page as the key for what makes the page distinct.  In your case, it might be the URL itself, or something in the data layer like the page_name.

Single score, this visit
Create a visit level boolean that tracks if the visitor has seen a qualifying page in this visit
The score you can then increment whenever this boolean is true, and has changed. This means they are seening a qualifying page for the first time in this visit

Tealium - Universal Data Hub 2018-06-25 16-47-23.png

Tealium - Universal Data Hub 2018-06-25 16-49-09.png

Single score, time window, not necessarily in a single visit
Create a visitor level date that stores the most recent time the visitor has viewed a qualifying page
Create a visitor level number that tracks the change in that date since the last event
The score you can then increment whenever the date is assigned, and has changed, as long as the change in date since the previous event is greater than one day
You need a special case to deal with the first time the visitor sees a qualifying page. In that case, the change in date will come out as exactly zero. If you want to also count that, then you can, as my screenshot shows.

Tealium - Universal Data Hub 2018-06-25 16-50-22.png

Tealium - Universal Data Hub 2018-06-25 16-51-08.png

Tealium - Universal Data Hub 2018-06-25 16-51-55.png

Multiple Scores

Both of the above deal with a single score, which is what I think you are asking. If you had many such scores, it would be possible to duplicate the logic for each. Alternatively, you might wish to save some effort by taking a different approach.

Multiple Scores, this visit
Create a Set of Strings at the visit level that tracks the keys for the pages the user has seen in this visit
Create a Number at the visit level that is the count of keys the user has seen (the count of items in the Set of Strings)
If this number has changed, then you can increment your score. You would also add a rule to only do this if the page qualifies for this particular score.

Tealium - Universal Data Hub 2018-06-25 16-53-09.png

Tealium - Universal Data Hub 2018-06-25 16-53-45.pngTealium - Universal Data Hub 2018-06-25 16-54-23.png

Multiple Scores, time window.
This is possible, but I have not tested it.

That approach is geared to giving you a favourite over a time window, but it also gives you a tally over the time window (called the "Master Tally" in that recipe). You store your page URLs in the Tally, and you make the length of the timeline 1 day (which equates to 24 hours, but only with respect to the start of the current visit, I believe)

You could then proceed similar to the "Multiple Scores, this visit" variant above.

Has this page been viewed before in current Session ?

Silver Contributor
Silver Contributor
Hi Mark, The link to the "Multiple Scores, time window." recipe does not work. Are you able to send it to me?

Has this page been viewed before in current Session ?

Tealium Employee

@william1 Sorry about that.  I cannot send you a PM with anything attached on here.  Maybe a better way is if @kathleen_jo can make that article public.

Has this page been viewed before in current Session ?

Employee Emeritus

Hi @mark_reddin. Let me work with @TealiumJustin on that document. Hold please...

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.
Public