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, click on a link etc), you can and need to track the clicks to see how many people clicked that call to action link.
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. This is an event where people download my CV, so I call the event name “CVDownload” (avoid spaces in naming your event). Set Type as class. For Event Category, I would like to call it something that reminds me where this event takes place, so, if this is an download happening on my flower page, I call it cvdownload.flower. Event Action is download, event label is flower. I leave the Event Value empty here, but you can enter a number if you like. Set Non-interaction to be “false”. Then click the “Add” link after you are done.
Now go back to your page or post (where the link is). In the “Code Editor” window find that link’s url and add: class=”CVDownload”
in front of the href code, like this:
<a class=”CVDownload” href=”https://docs.google.com/document/d/1-mIME4tjb3VcZQLEHxsGC6EtEpW1ilhxl8mjVCCyuEs/edit?usp=sharing”>Download My CV Here</a></p>
That is it! Now you have completed tracking a click.
To test this event tracking is happening, you can click on the tracked link yourself and then go to Google Analytics Real Time to see your click/event is been tracked! After a while, the tracking will be reported in the “Behavior”\Event like below: