Jeff Escalante a952148800 adjustments to analytics scripts
- remove existing GTM tag from head to prevent double tracking
- adjust selector to not include non-download links
- send a cleaner breakdown of download parameters for easier analysis
2018-04-02 12:30:15 -04:00

15 lines
418 B
JavaScript

document.addEventListener('DOMContentLoaded', function() {
track('.downloads .download .details li a', function(el) {
var m = el.href.match(/packer_(\d+\.\d+\.\d+)_(.*?)_(.*?)\.zip/)
return {
event: 'Download',
category: 'Button',
label: 'Packer | v' + m[1] + ' | ' + m[2] + ' | ' + m[3],
version: m[1],
os: m[2],
architecture: m[3],
product: 'packer'
}
})
})