Search code examples
adobe-analytics

Adobe DTM s.getPreviousValue() not working when used correctly?


This question is different from s.getPreviousValue plugin not working

Here's the difference: unlike the other question, which had some incorrect parameters, I am using the sample code straight from the documentation:

s.prop1 = s.getPreviousValue(s.pageName,'gpv_pn','');

The code is placed inside s_doPlugins like it's supposed to, in the Library Management -> Code Configuration -> Custom section of the Adobe Analytics tool configuration. Code is hosted in DTM.

Unfortunately the cookie gpv_pn is consistently set to the string "no value".

What could possibly be wrong?


Solution

  • Is this set after s.pageName is? Generally, this is a given, because doPlugins runs as the last thing before a beacon fires, but if you're setting pageName in doPlugins as well, you'd need to make sure getPreviousValue runs after it. If you add something like this: _satellite.notify("getPreviousValue is running, my pageName is "+s.pageName) Does your console show you the pageName for the current page?