Dinheiro icon indicating copy to clipboard operation
Dinheiro copied to clipboard

Track onclick events

Open davidduffett opened this issue 12 years ago • 0 comments

Provide a way to easily track onclick events by using the CSS class and HTML5 data- attributes.

A click could automatically be tracked just by adding a class to a link or button:

<a href="..." class="ga-event">This will be tracked</a>

In the case above, it would default to tracking "Link", "Click", "This will be tracked".

<a href="..." class=ga-event" data-event-category="Category" data-event-action="Click" data-event-label="My Link">This will be tracked</a>

The above would track "Category", "Click", "My Link".

davidduffett avatar May 07 '12 10:05 davidduffett