Track Outbound Links
Learn how to track outbound link clicks in Oppla
Track Outbound Links in Oppla
When a user clicks on a link to an external site, this event is normally not captured because the user is leaving the site where Oppla runs. However, you can use events to track this behavior.
Using Data Attributes
To track outbound links, add data attributes to the anchor tag containing the external link. When the tag is clicked, the event will be triggered. For example:
This sends an event named outbound-link-click with the value of url
set to the external URL.
Automating Event Attributes
If you don’t want to manually update all your anchor tags, use the following script to automatically add the event attributes to all outbound tags. Place this script at the bottom of your HTML body:
Verifying Outbound Link Tracking
After implementing the above, verify the tracking by clicking on an outbound link and checking the Events section in your Oppla dashboard.
💡 For further guidance, visit our Help Center or reach out to support.