data-track-click

The click is related to the content web component as can be read in the web components documentation.

A click can be related to products, promotions or contents. This would require a clickType. For more information about the possible clickTypes, read the content related interactions documentation.

It is also possible to trigger a content interaction based on a click. For more information read about content interaction.

<div data-track-click='{
    "clickType": "promotionClick",
    "promotions": [{
        "name": "Homepage header",
        "creative": "Baseball jacket 50% off"
    }]
}'>
...
</div>

The example above shows us how to track the click on a promotion on the homepage.

<div data-track-click='{
    "viewType": "productListClick",
    "products": [{
        "id": "123sdfsfd123",
        "name": "Baseball Jacket Grain",
        "price": 99.95,
        "list": "Featured items",
        "position" : 1
    }]
}'>
...
</div>

The above code is an example of tracking the click on an item in the “Featured items” list.

<div data-track-click='{
    "contentInteractionName": "appDownloaded"
}'>
...
</div>

The code above shows a way to trigger the “appDownloaded” content interaction.

Note

The tracking is only triggered when the elements with the data-attributes are clicked on.

data-track-multiple

By default the element can only be clicked once. If you want to track a click on an element multiple times. Then use the data-track-multiple attribute.

data-track-inner-links-only

Sometimes you want to only track clicks on links instead of any clicks on the element. To do this, you can use the data-track-inner-links-only attribute.

When you want to have more control about tracking elements. It is also possible to use our Javascript API.

Combine contentview and click

It can happen that you want to track a contentview and click on exactly the same element. This way it would be redundant to both use a data-track-contentview as well as a data-track-click. If this is the case, you could use the data-track-contentviewclick attribute.