Basic button tracking
Hi everybody!
I´ve a really basic question in regard of button clicks. We only want to know the number of clicks of a specific button. I know we can do that with class/id.
But is there a way to also track that with data layer? my dev team created a data layer that when a click is done it triggers the data layer (I believe its a data layer push as the page doesn't load again) and this data layer contains the "event: eventname" and "userId: xxxx".
Since the goal with this is to only get number of clicks, would it be best practice to do it with CSS?
Is there a way for it to work with data layer also? would the data layer need to send a value? for instance, now we have something similar to this:
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'nameoftheevent',
'UserId': xxxxx,
'loggedin': 'True'
});
but to track the number of clicks would we need to set something like a value=1 (click)
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'nameoftheevent',
'value': '1',
'UserId': xxxxx,
'loggedin': 'True'
});
if the data layer option works, how can I create its data element and rule? we have been using data layer manager and adobe analytics data string extensions so set data layer up.
thanks in advance