Analytics
4.5K members online now
4.5K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Anchor not seen as a separator

E S
Visitor ✭ ✭ ✭
# 1
E S
Visitor ✭ ✭ ✭

Hello,

I use # as separator in my marketing campaigns. On previous version of GA (ga.js), there was no problem, GA understood "#" as a "?".

Since I update the universal tracking code, pages are considered as different in GA reports / content / all pages (ie /page.html#utm_source=a isn't the same than /page.html#utm_source=b)


Yet I have set  allowAnchor : true in the tracking code. Any idea ? What's wrong with it ?

 <script>  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXX-X', 'auto', {'allowLinker': true, 'allowAnchor': true});
  ga('require', 'linker');
  ga('linker:autoLink', ['sub.domain.com', 'sub2.domain.com'] );
  ga('send', 'pageview');</script>

Thanks for your help !

1 Expert replyverified_user

Re: Anchor not seen as a separator

Rising Star
# 2
Rising Star
utm tracking is kept and processed regardless of setting allowAnchor to true, but when it's set it will also take into account any other parameters.

https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#overview

Do you actually see #utm_source=a and #utm_source=b in the All Pages report (you shouldn't)? Do you see other parameters? What are you trying to solve?

Re: Anchor not seen as a separator

E S
Visitor ✭ ✭ ✭
# 3
E S
Visitor ✭ ✭ ✭
Hello,

Thanks for your answer.

Indeed, I see all the marketing campaign parameters in the All Pages report (utm_source, utm_campaign, utm_medium)

Here is an example :
/folder/10533-page#utm_source=XXXX&utm_medium=XXXX&utm_campaign=XXXXX

I want to see only /folder/10533-page in my reports, because I have hundreds and hundreds entries for a same page

Re: Anchor not seen as a separator

E S
Visitor ✭ ✭ ✭
# 4
E S
Visitor ✭ ✭ ✭
In fact, with the previous version of analytics code, I don't have this problem.
Is it specific to Universal Analytics ?

Re: Anchor not seen as a separator

Rising Star
# 5
Rising Star
I see. Something is wrong somewhere, then, as utm parameters should not show up in the reports.

Have you verified the URLs where you have utm implemented to see if the implementation was done correctly? For example, that there aren't two hash tags or a a hash and a question mark or any other faulty implementation.

I'd start from there. When utm gets passed in the reports it's normally down to an implementation issue.

Re: Anchor not seen as a separator

Rising Star
# 6
Rising Star
No, it's not. Both Universal and Classic shouldn't show this problem. Again, instances when I have seen that was down to an implementation issue.