Track clicks of download links via Google Analytics.
- You will need to have Google Analytics installed for this package to work.
- Files will need to be served from a directory of
/downloads
.
npm add fv-analytics
Add this to your global app.js file.
import "fv-analytics";
To start tracking downloads, add the following class name to the elements:
<a href="..." class="download">...</a>
For dynamic elements that get added to the page, you will need to add this to your click handler:
trackDownload('file name');