Setting pagename to path in DTM

Avatar

Avatar

fixepah

Avatar

fixepah

fixepah

15-10-2015

I've got the following code to assign the path value to a data element:

if(location.pathname){
  return location.pathname;
}
else
  return '';

Is this correct if I want to have the URL path as the pagename value in the Pages report?   The reason I ask is I am seeing full URLs as Page values in the reporting.

Thanks!

View Entire Topic

Avatar

Avatar

Jason_Egan

Avatar

Jason_Egan

Jason_Egan

15-10-2015

I just do this and it works fine:

[img]Screen Shot 2014-09-16 at 4.21.41 PM.png[/img]

Also, if you want to see the output in the console, I'd suggest using "_satellite.notify()" and then looking at DTM in debug mode so that you don't have to worry about old browsers and "console.log()."

- Jason