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
BedrockMission!

Learn More

View all

Sign in to view all badges

Capture previous page name

Avatar

Avatar
Validate 1
Level 2
srikanths356410
Level 2

Likes

19 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
srikanths356410
Level 2

Likes

19 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
srikanths356410
Level 2

23-01-2018

How to capture previous page name value in prop using adobe dtm?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
christyw8416449
Level 2

Likes

16 likes

Total Posts

19 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
christyw8416449
Level 2

Likes

16 likes

Total Posts

19 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
christyw8416449
Level 2

31-01-2018

Here is what I did, and hopefully it will work for you.  I created a new data element and set the type to custom script.  In the editor I added the getPreviousValue() and split() plugin code and then called getPreviousValue() with the current page name, returning the return value.  I use this data element on all page views to fill in a prop and an eVar with the previous page name.

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
Level 2
haddnin
Level 2

Likes

4 likes

Total Posts

18 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 2
haddnin
Level 2

Likes

4 likes

Total Posts

18 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
haddnin
Level 2

30-11-2018

Hello Christy, I like your approach because I'm not comfortable with putting it in Library Management so that I can keep my code most recent version. I'm working with a Single Page App, so i'm not sure if this will work. Something's not working correctly because I'm not seeing anything returned.

Here's my data element custom code:

    /*

    * Plugin: getPreviousValue_v1.0 - return previous value of designated

    *  variable (requires split utility)

    */

    var s = _satellite.getToolsByType('sc')[0].getS();

    s.getPreviousValue=new Function("v","c","el",""

    +"var s=this,t=new Date,i,j,r='';t.setTime(t.getTime()+1800000);if(el"

    +"){if(s.events){i=s.split(el,',');j=s.split(s.events,',');for(x in i"

    +"){for(y in j){if(i[x]==j[y]){if(s.c_r(c)) r=s.c_r(c);v?s.c_w(c,v,t)"

    +":s.c_w(c,'no value',t);return r}}}}}else{if(s.c_r(c)) r=s.c_r(c);v?"

    +"s.c_w(c,v,t):s.c_w(c,'no value',t);return r}");

    /*

    * Utility Function: split v1.5 - split a string (JS 1.0 compatible)

    */

    s.split=new Function("l","d",""

    +"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"

    +"++]=l.substring(0,i);l=l.substring(i+d.length);}return a");

    return(s.getPreviousValue(s.pageName,'gpv_pn', 'event1'));

Does this look like your implementation?

Thanks!

Avatar

Avatar
Validate 1
Level 2
srikanths356410
Level 2

Likes

19 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
srikanths356410
Level 2

Likes

19 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
srikanths356410
Level 2

24-01-2018

Hi Abhijeet,

Thanks for your Idea. But I use DTM to manage my s_code file. So how do you suggest me to include the code given on getPreviousValue this page?

Avatar

Avatar
Boost 5
Employee
Abhijeet_Mishra
Employee

Likes

30 likes

Total Posts

73 posts

Correct Reply

35 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Employee
Abhijeet_Mishra
Employee

Likes

30 likes

Total Posts

73 posts

Correct Reply

35 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
Abhijeet_Mishra
Employee

23-01-2018

Hi,

You can use the 'getpreviousvalue' plug-in to achieve this.

Using this plug-in, you can capture the value of an Analytics variable on the next page view. For an example, capturing the s.pageName value from the previous page view into a Custom Traffic variable i.e. previous page value in a variable of your choice.

Avatar

Avatar
Validate 1
Level 2
srikanths356410
Level 2

Likes

19 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
srikanths356410
Level 2

Likes

19 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
srikanths356410
Level 2

23-01-2018

Hi Jantzen Belliston,

Thanks for helping me. Right now my next page flow reports have data in it. I would like to have a prop to capture them so that i can use it in my analysis workspace. But can you explain more about how to setup previous page report into a prop using cookie or data element?

Avatar

Avatar
Springboard
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

332 likes

Total Posts

2,248 posts

Correct Reply

811 solutions
Top badges earned
Springboard
Validate 500
Validate 250
Validate 100
Validate 50
View profile

Avatar
Springboard
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

332 likes

Total Posts

2,248 posts

Correct Reply

811 solutions
Top badges earned
Springboard
Validate 500
Validate 250
Validate 100
Validate 50
View profile
jantzen_belliston-Adobe
Community Manager

23-01-2018

Within Analytics, you could look into the pathing or previous page report.

Pathing

Previous Page

As for DTM, you could do this a number of ways, I'll list a few below:

1) Store the Page Name in a cookie or data element and retrieve and set to a prop when needed

2) Set the previous page name in a query string (site.com/page2?ppn=page1) and retrieve it when needed

3) If you are just looking for the referring domain (IE if someone found your site via another domain or search engine) you could tap into document.referrer for the referring URL.

Thanks,
Jantzen