Tracking Clicks, Links and Downloads with _trackEvent
Suppose if you want to see how effective your content is in promoting a certain call to action (e.g. download something, visit a promotional campaign page etc.), you can/need track the clicks to see how many people clicked that call to action link.
Oops, it is a train schedule, not a real book! But for the purpose of this demo, this should do. So if someone clicked on this link, they would be downloading a pdf.
Step 1: Install WP Google Analytics Events plugin
It looks like this:
In the general setting part enter your UA code, check universal code
Then save changes. Click on the “Click Tracking” Tab
Set up the information like the following
Now go back to your page or post (where the link is). In the text window find that link’s url and add: class=”FreeBookDownload”
<a class=”FreeBookDownload” href=”http://justinren.com/wp-content/uploads/2017/06/fitchburg-schedule.pdf”>Download Our Newest Book in PDF</a>
That is it! You can go to GA real time to see event tracking happening in real time!