Does anyone try to track the number of clicks in button (which is a custom lightning component) using google analytics?
We are using google analytics but it can only track page views.
2 条评论

Laurel is correct. You can use Google Analytics to add event tracking on your buttons directly. Or if you use Google Tag Manager you can set up event tracking on all button clicks, assigning them a name and even a conversion value if you want. Here's a resource: https://salesforce.stackexchange.com/questions/189862/how-to-use-google-analytics-for-lightning-component-controls-events It's not exactly what you're looking for but it points to the right direction. I recommend tracking them as events and not pageviews though.