mirror of https://github.com/hashicorp/packer
- 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 analysispull/6094/head
parent
2f18f24325
commit
a952148800
@ -1,9 +1,14 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
track('.downloads .download a', function(el) {
|
||||
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' + el.href.match(/\/(\d+\.\d+\.\d+)\//)[1]
|
||||
label: 'Packer | v' + m[1] + ' | ' + m[2] + ' | ' + m[3],
|
||||
version: m[1],
|
||||
os: m[2],
|
||||
architecture: m[3],
|
||||
product: 'packer'
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
Reference in new issue