Common Plugins Get Previous Value and New/Repeat Visitor Implementation | Community
Skip to main content
Level 2
May 10, 2021
Solved

Common Plugins Get Previous Value and New/Repeat Visitor Implementation

  • May 10, 2021
  • 3 replies
  • 4925 views

I have installed the 'Common Analytics Plugins Extension'


Created a Rule - Initialize Plugin's

and another Rule - Initialize Time Plugin

and in-browser console I am getting the function definitions as well.
This always returning the NEW instead of repeat.

 

but in the Cookies section - the gpv_pn cookie is not getting added, so based on this the previous page name not getting added. Once it will be drop, then with the help of the below code, will track the data.

 

 

s.prop9 = s.getPreviousValue(s.pageName,'gpv_pn'); s.linkTrackVars = "prop9";

 

 

 

Tried the Alternative approach as well.

Created one Common Plugin Rule and disabled the above two rules - 

 

 

then added the required things 

 

getting the same result in the console as well, but the gpv_pn cookie not dropping on the page

Please let me know if I missed something.

 

Thanks in advance.

 

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Charles_Thirupathi

@pratheeparunraj Thanks for Adding me in.

@kmaheshAdobe recommends using the individual plugin actions instead of  initializing all plugins in single action due to the increase in weight(size) of the extension.
Coming to queries
1. s.getPreviousValue getting undefined & gpv_pn cookie not setting.
   

If we call s.getPreviousValue() without passing arguments we will get undefined only, we have to pass the arguments like s.getPreviousValue(s.pageName,"gpv_Page") as per requirement.

From the details (screen grabs) shared i assume that you're trying to set s.prop1 with previous pageName value. For this we have to define like this s.prop9 = s.getPreviousValue(s.pageName,'gpv_pn'); and make sure that your setting this after s.pageName is defined, if you call "s.getPreviousValue(s.pageName,'gpv_pn');" before defining s.pageName it won't set cookie as s.pageName is getting undefined.

2. s.getNewRepeat();
   getNewRepeat() will return the visitor as "New" throughout visit(first visit after getNewRepeat is implemented) and from next visit it will return the visitor as "Repeat" till the cookie gets expired.


Thanks,
Charles

3 replies

PratheepArunRaj
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 10, 2021
Can you help here? Thanks much.
Thank You, Pratheep Arun Raj B (Arun) | Xerago | Terryn Winter Analytics
Charles_Thirupathi
Charles_ThirupathiAccepted solution
Level 4
May 10, 2021

@pratheeparunraj Thanks for Adding me in.

@kmaheshAdobe recommends using the individual plugin actions instead of  initializing all plugins in single action due to the increase in weight(size) of the extension.
Coming to queries
1. s.getPreviousValue getting undefined & gpv_pn cookie not setting.
   

If we call s.getPreviousValue() without passing arguments we will get undefined only, we have to pass the arguments like s.getPreviousValue(s.pageName,"gpv_Page") as per requirement.

From the details (screen grabs) shared i assume that you're trying to set s.prop1 with previous pageName value. For this we have to define like this s.prop9 = s.getPreviousValue(s.pageName,'gpv_pn'); and make sure that your setting this after s.pageName is defined, if you call "s.getPreviousValue(s.pageName,'gpv_pn');" before defining s.pageName it won't set cookie as s.pageName is getting undefined.

2. s.getNewRepeat();
   getNewRepeat() will return the visitor as "New" throughout visit(first visit after getNewRepeat is implemented) and from next visit it will return the visitor as "Repeat" till the cookie gets expired.


Thanks,
Charles

KMaheshAuthor
Level 2
May 11, 2021

Hi @charles_thirupathi,

 

Thanks for your time on call.

As we checked, the implementation part is good, the issue with the domain only.

 

Once will get the Publish instance, then will cross-check again.

Thanks,

jantzen_b
Adobe Employee
Adobe Employee
May 24, 2021
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?
March 23, 2022

@jantzen_b 

 

Created a rule to initialize the plugin:

Created dataelement to store the value with code:

 

 

Setting variables and sending beacon

 

 

When I load the page , I see this in console. The getPreviousValue isn't working or dropping any cookie on the page

 

Could you please guide me on this.