I am interested to know how can I add outbound link tracking via Analytics.
The code for event tracking is below, so since this probably falls outside templates, I suppose one of core files would need to be modified.
Ideally the event_label tag, should have the outgoing link auto-inserted.
Question is which core file handles URLs inside messages, profile posts, sidebar link etc... ?
Thanks
The code for event tracking is below, so since this probably falls outside templates, I suppose one of core files would need to be modified.
Code:
<a onclick="gtag('event', 'click', { 'event_category': 'Outgoing Link', 'event_label': 'https://example.com/' });" href="https://example.com/"></a>
Ideally the event_label tag, should have the outgoing link auto-inserted.
Question is which core file handles URLs inside messages, profile posts, sidebar link etc... ?
Thanks