Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Common Plugins Get Previous Value and New/Repeat Visitor Implementation

KMahesh
Level 2
Level 2

I have installed the 'Common Analytics Plugins Extension'


Created a Rule - Initialize Plugin's

KMahesh_0-1620638653994.png

and another Rule - Initialize Time Plugin

KMahesh_2-1620638846743.png

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

KMahesh_1-1620638806263.png

 

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 - 

 

KMahesh_3-1620639659007.png

 

then added the required things 

KMahesh_4-1620639705232.png

 

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

KMahesh_5-1620639744624.png

KMahesh_6-1620639787144.png

Please let me know if I missed something.

 

Thanks in advance.

 

 

 

 

 

 

1 Accepted Solution
Charles_Thirupathi
Correct answer by
Level 3
Level 3

@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

View solution in original post

7 Replies
Charles_Thirupathi
Correct answer by
Level 3
Level 3

@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

View solution in original post

KMahesh
Level 2
Level 2

Hi @Charles_Thirupathi,

Thanks for your reply.

 

Yes, I agree like Adobe recommended using the individual plugins. I tried this at first, but it was not working, that's why followed that approach as well.

 

Yes we have to call the s.getPreviousValue(s.pageName,"gpv_Page") after setting of page name only.

Followed the same steps.

Created one Page Bottom Rule - in which I am passing the page name via data layer.

KMahesh_0-1620657969358.png

 

KMahesh_1-1620657999421.png

 

After this Rule, Created one Window load rule, in which I passed the below code

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

 

and tried with the Extension - Configure Tracker Using Custom Code as well

No Luck. No cookie adding.

 

Thanks,

 

Charles_Thirupathi
Level 3
Level 3

@KMahesh Are you defining s.pageName as well?  before calling s.getPreviousValue(s.pageName,'gpv_pn'); ? because screenshot shows that you're capturing pageName in eVar4. If s.pageName is not defined then pass s.eVar4 as argument instead of passing s.pageName like s.getPreviousValue(s.eVar4,'gpv_pn');

KMahesh
Level 2
Level 2

Hi @Charles_Thirupathi,

 

Generic Page load Rules triggers at the bottom in which we are getting the page Name as eVar4.

As you suggested, passed eVar4 as an argument also, still no luck.

 

Extension - Custom Editor - 

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

 

Window Load Rule - 

Also added, but still the same.

Charles_Thirupathi
Level 3
Level 3

@KMahesj, can you able to join below link https://meet.google.com/ofq-nnfd-cbk . so that we can review the implementation & solve this.

KMahesh
Level 2
Level 2

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,

KMahesh
Level 2
Level 2

Reviewed in the proper domain host URL, and it's working as expected.

Thanks,

jantzen_belliston-Adobe
Level 10
Level 10
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?