To follow up on what I wrote yesterday (Tracking external links in Google Analytics and browser behaviour) about how event.Preventdefault can break things I thought I'd share what I was working on when discovering that.
The code below makes Google Analytics track the following events:
- Clicks on external links
- Clicks on internal files
- Clicks on external files