Have you been wondering how to track on-page clicks? It sounds mystifying, but it doesn’t have to be. The following is an awesome code to add to for any marketing client to track on-page clicks. The click will act like a conversion, so you don’t need a landing page.
It is useful for tracking PDF downloads, video plays, or any click event on the site (perhaps even clicks to contact you by phone).
Update your normal link:
<a href=”/files/Diminished-Value-eBook.pdf” target=”_blank>Download</a>
<a href=”/files/Diminished-Value-eBook.pdf” target=”_blank” onclick=”ga(‘send’, ‘event’, ‘Download eBook’, ‘Click’, ‘Download eBook’);”> Download </a>
Essentially, you add in this code:
onclick=”ga(‘send’, ‘event’, ‘Download eBook’, ‘Click’, ‘Download eBook’);”>
What does this mean? Good question:
- Send = mandatory field to tell Google what to do.
- Event = mandatory field to tell Google what to do.
- Download eBook = This is the event category. In this case, we called the event Download eBook.
- Click = mandatory field for type of interaction. We used click, but you can also use play for a video.
- You can also add in an event value with the event, but we did not need one here.
Once you add the code, just login to Google Analytics and setup an event with that name.
- Go to Goals
- Add a New Goal
- Click Custom
- Click Event
- See Screenshot to add details to match labels.
And if that piqued your interest, there’s more information to be found.