Clicks can also be measured by adding attributes to HTML tags.
The advantage of this is not having to call NPO.click directly.
Click attributes can be set on an <A> tag or on a tag containing an <A> tag.
The attributes needed to make this work are data-ts-click and data-ts-type.
The type needs to be set to one of these: “exit”, “download”, “action” or “navigation”.
The tagged element does not to be present at load time; elements added after npotag.js has been loaded will be registered automatically.
<a href="https://www.google.nl" data-ts-click data-ts-type="navigation">Some tagged link</a>
A number of attributes are optional:
data-ts-name, this attribute is meant for the click label. If not present, the value of NPOLabels.pagina will be used.data-ts-niveau1, this attribute is meant to override the value of NPOLabels.niveau1.data-ts-niveau2, this attribute is meant to override the value of NPOLabels.niveau2.data-ts-niveau3, this attribute is meant to override the value of NPOLabels.niveau3.<a href="https://www.like.com" data-ts-click data-ts-type="action" data-ts-name="like-button" data-ts-niveau1="social-bar">
Some social action
</a>