Hi there,
I do initialize the getPreviousValue-Plugin with Data Collection and then setting two eVars by using an additional rule, the Adobe Analytics extension and custom code looking like this:
s.eVar18 = s.getPreviousValue(s.pageName,"gpv_pageName");
s.eVar19 = s.getPreviousValue(s.channel,"gpv_siteSection");
Everything is working fine for this. Cookies are set, eVars are set as soon as cookies have a value.
Now, I'm trying to add an additional line, looking like this:
s.eVar17 = s.getPreviousValue(s.eVar2,"gpv_pageId");
For this one, no cookie is built and therefore no eVar is set while eVar2 exists in the tracking calls.
Can someone tell me why?
Solved! Go to Solution.
Views
Replies
Total Likes
are you sure that eVar2 has been set by the time you are calling getPreviousValue?
What if you log it in the console? Do you see an actual value present?
_satellite.logger.debug(">>> this is eVar2", s.eVar2);
Hmm on the surface, this looks fine...
The only thing I can think of is your eVar2 being explicitly set? Or is it maintaining a value from a previous page (I assume not since it's called "page id", so I would expect that to be set for every page)
There should be no difference between maintaining the value of pageName or channel, or an eVar.... I even see eVars in the examples in the documentation.
Are you seeing any errors in your console?
I don't use this plugin, so to try and replicate I need to do some setup....
Views
Replies
Total Likes
Thanks for your thoughts. I don't get any console errors. You're right, s.eVar2 is set on every page tracking call. It feels weird that both others are working as expected, seeing no difference to s.eVar2.
Views
Replies
Total Likes
It really does.... just for a test.. can you try something else? just to see if the cookie gets properly set? Maybe try a prop and another eVar (something that should always be there)...
Views
Replies
Total Likes
are you sure that eVar2 has been set by the time you are calling getPreviousValue?
What if you log it in the console? Do you see an actual value present?
_satellite.logger.debug(">>> this is eVar2", s.eVar2);
That's it. I just changed the load order so that the rule explicitly for the GPV-values is a step after the "basic variable" set and now it's working. This means eVar2 wasn't set when the GPV jumped in—timing issue.
Great you figured it out!
Yes, glad you figured it out
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies