Book Image

Magento Search Engine Optimization

By : Robert Kent
Book Image

Magento Search Engine Optimization

By: Robert Kent

Overview of this book

Table of Contents (15 chapters)
Magento Search Engine Optimization
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 template files (typically within the header.phtml file):

<a href="tel:555123123" onclick="_gaq.push(['_trackEvent','Click-to-Call','Head Area','555-123-123']);">555-123-123</a>

In this example, we will track the click event on our phone...