How to record which users are leaving your site on Google Analytics
As a website (or app manager), I oftentimes ask myself this question, "How many users are we sending to our external partner sites? Also, how many are we sending on a monthly basis?"
Google Tag Manager can certainly help you answer this question but oftentimes, the tool is too much overkill to use. For this reason, I still prefer using this jQuery script.
How does this script work?
This script simply listens for whenever a user clicks a link. When the link is clicked, it decides whether the link is an outbound link. If it is, it publishes the event to Google Analytics.
Where do I see the report?
You'll see the report in Google Analytics under "Behavior" > "Events"
How do I install this script?
It's super simple. All you do is script paste this at the bottom of your page (or template) and modify the comment CHANGE ME.