Adding events to track phone number clicks

Event tracking is an extremely useful tool and allows us to track customer interaction with any part of a page. It uses simple JavaScript events, such as onclick, to push data to GA so that we can analyze factors that may not be picked up as standard.

A common usage of click-based event tracking would be to analyze how many customers click on our company phone number—possibly in order to get help when browsing our website. Using our e-commerce tracking data, we could then see how many of these events resulted in sales, perhaps giving an indication as to the level of support provided by our telephone operators.

In order to do this, we would simply add the following code to our phone number within the Magento ...

Get Magento Search Engine Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.