We have a set of pages being tracked with events in our site. So if the customer lands in step-1 we fire an event. The problem is if the customer goes back from step-2 to step-1 we fire the event again.
To avoid this, I tried to create an extension that looks at the pagename and previous page name setting a new value in a variable if the previous page name doesn't equal step-2 or step-1.
I cannot make it to work.
Every time I try to use previos page name value in the extension my variable gets undefined. I looked and we have ct.s_ppn value BLR so not sure why isn't working. I also tried to use the mapping we have with adobe (use prop value instead of previous_page_name variable), changing when the tag should load, changing tag scope...
Does anyone knows why I'm unable to make it work? or knows how to use PPN as a condition for a set value data extension?
Solved! Go to Solution.
Hi Gavin, Thanks for your answer!
Could you explain a littel more how could I do this?
At the moment I set up a cookie that tells me which step are the in in the journey. I was trying to store the value of the highest step they've been but couldn't work it out without creating one cookie for each step.
Really appreciate the help :)
So, here's what i'm thinking.
You want a flag that allows you to only fire on first visit to a step. Subsequent views, should not fire a step.
lets say you setup a cookie, called ct.step_visited
On first step page view, you drop the initial cookie with a value of 's1'
when the 2nd step is loaded, you read the same cookie and append the next step so the result should be an updated cookie with value 's1-s2'
and so on and so forth.
The extention condition for firing the event should check that the cookie does not contain the flag for the relevant step. Page is Step 1 and Cookie does not contain s1
Even if you ended up with mulitple step visits so the cookie reads 's1-s2-s1' The condition will still work...
then get rid of the cookie once the sequence is complete.
Hope that helps
Thanks so much for the detailed answer.
I'm going to use this approach, will let you know how it goes! :)
One more question I have. When you say at the end "get rid of the cookie" wouild it be enough to set it as a session cookie? Or how do I get rid of the cookie?
As you can see I'm not very experienced with cookies in general... :S
Pleasure, glad i could help.
To 'get rid of a cookie', you effectivly expire the cookie.
When setting it, set against a fixed time expiry, something long enough for the sequence, say 1 hour or so.
When the sequence ends you simply update the cookie time setting to 0 time or an earlier time period and this will expire the cookie.