SPA link_click tracking


#1

Hi, I have a SPA client with backbone.js, I realize link_click event is not being track for all my links, I check and you are adding event listeners to links in the list document.links, which does not have all the links added with js. I would like to know what would be the less invasive way to start tracking all my link clicks.

Thanks.


#2

@jose, the links (<a href=...>) will be tracked automatically if they are present in DOM once the tracker has loaded (and enableLinkClickTracking is initiated). Any other autogenerated links added later on would have to be engaged by calling the refreshLinkClickTracking method after the link was added to DOM: https://github.com/snowplow/snowplow/wiki/2-Specific-event-tracking-with-the-Javascript-tracker#392-refreshlinkclicktracking. Also note the other HTML elements used in link capacity (ex. <button>) will not be tracked without a “manual” tracking with trackLinkClick.