Hi, can anyone tell me how to track click Under the following conditions in Launch? I'm using Launch for the first time. However, we are in trouble because no one in the company has ever used it before.
1. How to divide a single value into multiple events in using CSS Selectors. example） ・Button A： class= "adobeclick" →event1 ・Button B： class= "adobeclick" →event2
2.How to measure the clicks of a link that is not onClick.
3.How to click measurement in case of Ajax communication
Can anyone tell me how to setup this rule correctly to track clicks for this button.
if you want different values set for different buttons, you need to setup different rules. and this only works if sou can identify each single button (so just using a css class "AdobeClick" is not enough. I personally prefer to add a "data-analytics-track" parametrr to the buttons/links Inwant to track where I pass additional information about the link (and that helps me to setup the rules).
example in source code would look like: <button .... data-analytics-track="firstButton">
Urs gave a few good points but here's some more assistance.
1. If you do not have access to the HTML and you only have class. You can use index placement in the DOM. Just a note, if HTML changes, your code may break. Urs comment on using data-attributes is a far better approach. But for a quick solution, you will want to know where Button A and Button B is placed. There are two approaches to this. One is easier, the other is harder but covers more browsers.
From there, you can just add a click listener and then fire "trigger()"
3. AJAX clicks are interesting as you can listen via network calls as a last ditch effort (if you don't have access to the code) but you can also just fire custom events alongside the ajax call (if you have access). I would refer to Urs' links for dispatching events or using the datalayer.