Event tracking
In addition to the number of pages, site counters also count events taking place within a site. Examples of events include the number of clicks on a hyperlink or the number of times a form or form field has been completed.
Google uses the function trackEvent to count events.
In Profit, it has been decided to create events for all internal and external hyperlinks. This means the counter contains a lot of data you do not need. In Google Analytics, you can set filters so you only see the data you actually need.
Hyperlinks can be found in the following locations:
- Menu items within the sites
- Hyperlinks in descriptions
- Hyperlinks in the site header and footer
You can use these to measure how often each menu item is used, which links are used to reach a page and which links are used to leave a page.
The hyperlinks are given this code:
<a href="#" onClick="_gaq.push(['_trackEvent', 'Hyperlink', 'Bestellen']);">Bestellen</a>
<img onClick="_gaq.push(['_trackEvent', 'Hyperlink', 'Bestellen']);" />
Note:
If you use Flash animations with hyperlinks, you can add a Google Analytics code to the hyperlinks in Flash yourself so the clicks are recorded by the Google Analytics counter.