Analytics
3.5K members online now
3.5K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Can't get PDF event tracking working on Squarespace

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi guys,
I'm having a lot of trouble tracking PDF downloads as events with Analytics, and I'm thinking it's some sort of incompatibility with our Squarespace setup. Can anyone help?


The most recent code I've tried, which is currently live on the site, is <a href="LINK" onClick="ga(‘send’, ‘event’, ‘PDF Downloads’, ‘Click’, ‘Link Title’, ,{‘NonInteraction’: 1});">DOWNLOAD</a>

 

with a corresponding goal set up to track the event. (via https://www.seoworks.com/01-seo-news-views/track-file-downloads-in-google-analytics-using-gtm/)

 

I've also tried the individual tracking code on this page http://www.blastam.com/blog/how-to-track-downloads-in-google-analytics , and the automation script on that page. Nothing ever registers as an event, even when I give it a few days processing time.

 

Our site is here, if you want to check the code (linking to the page where the first link has the latest code test implemented) http://www.75f.io/papers/

 

Thanks guys

Marked as Best Answer.
Solution
Accepted by James_Clemens (Top Contributor)
November 2016

Re: Can't get PDF event tracking working on Squarespace

[ Edited ]
Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

Hi Sarah,

 

Try this one:

 

<a href="LINK" onclick="ga('send', 'event', 'PDF Downloads', 'Click', 'Link Title', {'nonInteraction': 1});">DOWNLOAD</a>

 

So your code should look like this:

 

<a href="http://static.squarespace.com/static/54d634c2e4b07d1a0b83bde6/t/5727f4231d07c08dad9018b0/1462236197923/75F_Deep-Thoughts_TheEMSisDead.pdf" onclick="ga('send', 'event', 'PDF Downloads', 'Click', 'The EMS Is Dead', {'nonInteraction': 1});">DOWNLOAD</a>


I guess the problem is that you have used invalid quotes in your code.

 

Hope this helps. Let us know how it goes.

Taavi

Can't get PDF event tracking working on Squarespace

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Taavi,

Thank you, I appreciate it! Unfortunately, it still isn't tracking.

Re: Can't get PDF event tracking working on Squarespace

[ Edited ]
Participant ✭ ✭ ✭
# 4
Participant ✭ ✭ ✭

Hi Sarah,

 

It worked if I clicked on the DOWNLOAD link. This information was sent to your Google Analytics property (UA-64537306-1):

 

event.png

 

You should click on the first DOWNLOAD link and then open your Google Analytics Real-Time report -> Events and there you'll see this event right away.

 

Hope this helps. Let us know how it goes.

Taavi

Can't get PDF event tracking working on Squarespace

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Aha! It's working now, there was just a delay for me - thank you so much, I really appreciate it