Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

HELP!!!2 version of links for same page in Pages report

Avatar

Level 1

Hi,

 

I am seeing two versions of link for the same page in Pages report under Site Content menu - for example:

http://www.myhome.com

myhome.com

There are two links for every page - one with http://www. and one without, it's making my page report a mess.

 

Please help!!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Xueqing, welcome to the community!

Your issue is directly related to data collection, likely because you do not have s.pagename defined. Due to this and due to how different browsers handle URLs, some include the protocol and subdomain while others do not. I would recommend altering the implementation on your site to make sure s.pageName is consistent. Commonly users will set the pageName to document.title, or use things like breadcrumbs to make it more descriptive.

If URL is what you're after, I'd recommend the following code:

s.pageName=location.hostname+location.pathname;

This will strip the protocol and query strings from the URL so they don't create separate line items. The bottom line however is that you are going to want to alter the implementation on your site - there's really no easy way around that.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi Xueqing, welcome to the community!

Your issue is directly related to data collection, likely because you do not have s.pagename defined. Due to this and due to how different browsers handle URLs, some include the protocol and subdomain while others do not. I would recommend altering the implementation on your site to make sure s.pageName is consistent. Commonly users will set the pageName to document.title, or use things like breadcrumbs to make it more descriptive.

If URL is what you're after, I'd recommend the following code:

s.pageName=location.hostname+location.pathname;

This will strip the protocol and query strings from the URL so they don't create separate line items. The bottom line however is that you are going to want to alter the implementation on your site - there's really no easy way around that.

Avatar

Level 1

Hi Gigazelle,

 

Thanks for your reply! I'm pretty sure the s.pagename is set up already, however I'm still getting two line items.

Is it possible relating to angular java site?

 

Thanks again,

Olivia