AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
3.5K members online now
3.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

Bug with cross domain links containing URL fragments

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I found a bug with cross domain links containing URL fragments.

 

I have a link on my site to another domain, like "https://www.other.domain.com/m#fragment?param=value"
When I click it, google analytics converts it to the link "https://www.other.domain.com/m&_ga=1.49616230.1994355357.1444774781#fragment?param=value"

 

This is an invalid link and is 404ing.

 

It should convert it to
"https://www.other.domain.com/m?_ga=1.49616230.1994355357.1444774781#fragment?param=value"
or
"https://www.other.domain.com/m#fragment?param=value&_ga=1.49616230.1994355357.1444774781"

 

Either of these would be acceptable.

 

Thanks.

1 Expert replyverified_user

Re: Bug with cross domain links containing URL fragments

Top Contributor
# 2
Top Contributor
Hi Philip,

if the decorate utility is creating trouble for the query portion of the URL you can try decorating the anchor part of the url as describe here: https://developers.google.com/analytics/devguides/collection/analyticsjs/cross-domain?hl=en#autoanch...

Hope it helps!

Kind regards,
Zorin

Web analyst @ escapestudio.net