GetPageName Plugin using DTM

Avatar

Avatar
Validate 10
Level 3
sanmeetw1519854
Level 3

Likes

19 likes

Total Posts

40 posts

Correct reply

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

Avatar
Validate 10
Level 3
sanmeetw1519854
Level 3

Likes

19 likes

Total Posts

40 posts

Correct reply

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

15-10-2015

hi,

I am trying to use the getPageName plugin. But I am getting the following error -

cannot read property 'location' of undefined. Can someone help me with this?

Regards,

Sanmeet

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 2
jchuck5612
Level 2

Likes

7 likes

Total Posts

24 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Applaud 25
View profile

Avatar
Boost 5
Level 2
jchuck5612
Level 2

Likes

7 likes

Total Posts

24 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Applaud 25
View profile
jchuck5612
Level 2

15-10-2015

Hi Sanmeet,

I ran into the same issue but it wasn't related to DTM. It was related to upgrading from H.25 code to AppMeasurment.js. A function that getPageName() relies on was removed in AppMeasurement.js.  The code below should help you get the plugin working again if you still need it. the JavaScript below was provided to me by Adobe Support.

To use this, just paste it directly after " function s_doPlugins(s) {  "

    s.wd=window;
    s.fl=new Function("x","l",""
    +"return x?(''+x).substring(0,l):x");
    s.pt=new Function("x","d","f","a",""
    +"var s=this,t=x,z=0,y,r,l='length';while(t){y=t.indexOf(d);y=y<0?t[l"
    +"]:y;t=t.substring(0,y);r=s[f](t,a);if(r)return r;z+=y+d[l];t=x.subs"
    +"tring(z,x[l]);t=z<x[l]?t:''}return''");
    s.rep=new Function("x","o","n",""
    +"var a=new Array,i=0,j;if(x){if(x.split)a=x.split(o);else if(!o)for("
    +"i=0;i<x.length;i++)a[a.length]=x.substring(i,i+1);else while(i>=0){"
    +"j=x.indexOf(o,i);a[a.length]=x.substring(i,j<0?x.length:j);i=j;if(i"
    +">=0)i+=o.length}}x='';j=a.length;if(a&&j>0){x=a[0];if(j>1){if(a.joi"
    +"n)x=a.join(n);else for(i=1;i<j;i++)x+=n+a[i]}}return x");
    s.ape=new Function("x",""
    +"var s=this,h='0123456789ABCDEF',f='+~!*()\\'',i,c=s.charSet,n,l,e,y"
    +"='';c=c?c.toUpperCase():'';if(x){x=''+x;if(s.em==3){x=encodeURIComp"
    +"onent(x);for(i=0;i<f.length;i++){n=f.substring(i,i+1);if(x.indexOf("
    +"n)>=0)x=s.rep(x,n,'%'+n.charCodeAt(0).toString(16).toUpperCase())}}"
    +"else if(c=='AUTO'&&('').charCodeAt){for(i=0;i<x.length;i++){c=x.sub"
    +"string(i,i+1);n=x.charCodeAt(i);if(n>127){l=0;e='';while(n||l<4){e="
    +"h.substring(n%16,n%16+1)+e;n=(n-n%16)/16;l++}y+='%u'+e}else if(c=='"
    +"+')y+='%2B';else y+=escape(c)}x=y}else x=s.rep(escape(''+x),'+','%2"
    +"B');if(c&&c!='AUTO'&&s.em==1&&x.indexOf('%u')<0&&x.indexOf('%U')<0)"
    +"{i=x.indexOf('%');while(i>=0){i++;if(h.substring(8).indexOf(x.subst"
    +"ring(i,i+1).toUpperCase())>=0)return x.substring(0,i)+'u00'+x.subst"
    +"ring(i);i=x.indexOf('%',i)}}}return x");
    s.epa=new Function("x",""
    +"var s=this,y,tcf;if(x){x=s.rep(''+x,'+',' ');if(s.em==3){tcf=new Fu"
    +"nction('x','var y,e;try{y=decodeURIComponent(x)}catch(e){y=unescape"
    +"(x)}return y');return tcf(x)}else return unescape(x)}return y");
    s.parseUri=new Function("u",""
    +"if(u){u=u+'';u=u.indexOf(':')<0&&u.indexOf('//')!=0?(u.indexOf('/')"
    +"==0?'/':'//')+u:u}u=u?u+'':window.location.href;var e,a=document.cr"
    +"eateElement('a'),l=['href','protocol','host','hostname','port','pat"
    +"hname','search','hash'],p,r={href:u,toString:function(){return this"
    +".href}};a.setAttribute('href',u);for(e=1;e<l.length;e++){p=l[e];r[p"
    +"]=a[p]||''}delete a;p=r.pathname||'';if(p.indexOf('/')!=0)r.pathnam"
    +"e='/'+p;return r");
    s.gtfs=new Function(""
    +"var w=window,l=w.location,d=document,u;if(!l.origin)l.origin=l.prot"
    +"ocol+'//'+l.hostname+(l.port?':'+l.port:'');u=l!=w.parent.location?"
    +"d.referrer:d.location;return{location:s.parseUri(u)}");

Hope that helps!

Answers (2)

Answers (2)

Avatar

Avatar
Boost 1
Level 1
bharathn5518533
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
bharathn5518533
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
bharathn5518533
Level 1

15-07-2016

Thanks! this helped me 🙂

Avatar

Avatar
Give Back 50
Level 6
Rahsing
Level 6

Likes

17 likes

Total Posts

368 posts

Correct reply

132 solutions
Top badges earned
Give Back 50
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Give Back 50
Level 6
Rahsing
Level 6

Likes

17 likes

Total Posts

368 posts

Correct reply

132 solutions
Top badges earned
Give Back 50
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
Rahsing
Level 6

15-10-2015

Hi,

Could you please elaborate on your setup and what it is you're trying to capture.

Thanks

Rahul