Expand my Community achievements bar.

SOLVED

Page URL in Analytics

Avatar

Level 2

Hi,

 

I want to send a different pageURL than the current one:

 

Instead of https://example.com/path/x/y, I want to send analytics https://example.com/path, I tried to use the vars pageURL and pagePath, but when I debug with the Chrome Extension Adobe Experience Platform Debugger, I still see the full URL and not the edited one.

 

What should I do in order to not  log the full URL?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

There are 2 "pageURLs" that show in the debugger.. I believe the one a the top is really just a visual mapping to what page is being tested, but that isn't the info being sent to analytics....

 

The "g" value, or the "PageURL" as tracked in Adobe is the second one, the one that shows about mid-way down the debugger in alphabetical order

 

Jennifer_Dungan_0-1698331647636.png

 

The one at the top is paired with "Page Title" which also isn't something that is sent to Adobe by default, but the later one is paired with "Page Name" which is the "pageName" value that does go to Adobe.

 

Check both fields and see if the second one is getting your modified value...

 

Though, I would suggest that you not modify the Page URL (unless you are just doing it to sanitize PII - like an email passed through a querystring), you can always use an eVar for a "processed path" URL variation...  PageURL is really your only truly identifiable value of where the user was on the site, and is only available in Data Warehouse and Raw Data Exports.... 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

There are 2 "pageURLs" that show in the debugger.. I believe the one a the top is really just a visual mapping to what page is being tested, but that isn't the info being sent to analytics....

 

The "g" value, or the "PageURL" as tracked in Adobe is the second one, the one that shows about mid-way down the debugger in alphabetical order

 

Jennifer_Dungan_0-1698331647636.png

 

The one at the top is paired with "Page Title" which also isn't something that is sent to Adobe by default, but the later one is paired with "Page Name" which is the "pageName" value that does go to Adobe.

 

Check both fields and see if the second one is getting your modified value...

 

Though, I would suggest that you not modify the Page URL (unless you are just doing it to sanitize PII - like an email passed through a querystring), you can always use an eVar for a "processed path" URL variation...  PageURL is really your only truly identifiable value of where the user was on the site, and is only available in Data Warehouse and Raw Data Exports.... 

Avatar

Level 1

hi @UKCH 

suggest to use a new data element to get desire value of the page URL.
here is the simple code which could of use for your requirement, try this.
var host = document.location.hostname
console.log("host= "+ host);
var path = document.location.pathname
console.log("path ="+path);
var result = "https://" + host + path.substring(0,path.indexOf("/",1)+1)
console.log("result ="+result)

the result value of the data element you can assign to the evar.

hope this helps.

Thanks,