ckportfolio.com - Event Tracking (Advanced)

Event Tracking (Advanced)

Tracking Individual Clicks

While Google Analytics may be actively monitoring the website, it also provides us a flexible option of tracking individual events that occur in the website. For instance:

Using custom code, we can track all the clicks made to the email link, even if that link does not redirect to any web page. Refer to the following documentation:

https://developers.google.com/analytics/devguides/collection/gtagjs/events

Note that this jumps into the realm of Javascript, and that you are not expected to fully learn this concept. What we can take away is the following snippet:

The above code sends a customized signal to Google Analytics, and this can be implemented this way:

Placing a version of the above snippet under the "onclick" attribute simply allows us to broadcast a tracking event for Google Analytics to store. This can be accessed in "Events" under "Behavior":

All done: we now have the capacity to build larger, more complex websites complete with user traffic monitoring.

Screencast Recording

https://drive.google.com/open?id=1lZzKESp86C8crw9CtzoyPn258aqkH8Vh

Fin