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.4K members online now
3.4K 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

Link to #id in own page generates double tags

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I'm debugging my page www.henryaudio.com in Chrome with the Tag Assistant. When I click the top-right "Buy" or the "Buy now" in the picture the page scrolls to the right section. BUT: each of my two tags (GA and remarketing) appear twice.

 

Any idea why tags get replicated when linking to an #id on the same page and following that link?

 

 

Best regards,

Borge

Re: Link to #id in own page generates double tags

A T
Participant ✭ ✭ ✭
# 2
A T
Participant ✭ ✭ ✭
Tag is triggering only once on click.

You can easily debug on the website with GA debugger:
https://chrome.google.com/webstore/detail/jnkmfdileelhofjcijamephohjechhna

You can check in chrome, console tab with 'Preserve log' turned ON.

Re: Link to #id in own page generates double tags

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
The GA debugger doesn't really tell me all that much here.

What I see is that when the page is first loaded, the two expected tags are set. When I click on a same-page link with #id1, the two tags are replicated. When I keep clicking on other same-page links #id1, #id3 etc. the number of tags remains at 4.

I wish to know if there are known issues with tag replication with same-page links. All I want to do is let the user scroll up and down.


Best regards,
Børge

Re: Link to #id in own page generates double tags

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
The reason may be in how I track the clicks. A click on the "Reviews" button in the header has the following code:
<a href="#reviews" onclick="ga('send', 'pageview', '/Clicks-Navigation-Reviews_header');">Reviews</a>

So here ga() sends a different pageview while it is still on the same page. However, when I click on other links on the same page with the same style but different content, the tags are not replicated again.


Best regards,
Borge

Re: Link to #id in own page generates double tags

A T
Participant ✭ ✭ ✭
# 5
A T
Participant ✭ ✭ ✭

Re: Link to #id in own page generates double tags

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
I just changed ga(send pageview..) to ga(send event..) It still shows the same tag duplication when I click on that link. So I suspect this has to do with same-page linking and not the flavor of the tracking message.

<a href="#purchase-info" onClick="ga('send', 'event', 'Click', '/Clicks-Navigation-Buy_picture', 'Scroll');">Buy now</a>

Børge