fix download tracking analytics events
This commit is contained in:
parent
b5cb5f300b
commit
d4cf8b088e
|
@ -2,14 +2,16 @@ document.addEventListener('turbolinks:load', function() {
|
||||||
analytics.page()
|
analytics.page()
|
||||||
|
|
||||||
track('.downloads .download .details li a', function(el) {
|
track('.downloads .download .details li a', function(el) {
|
||||||
var m = el.href.match(/vagrant_(.*?)_(.*?)_(.*?)\.zip/)
|
var version = el.dataset.version
|
||||||
|
var os = el.dataset.os
|
||||||
|
var arch = el.dataset.arch
|
||||||
return {
|
return {
|
||||||
event: 'Download',
|
event: 'Download',
|
||||||
category: 'Button',
|
category: 'Button',
|
||||||
label: 'Vagrant | v' + m[1] + ' | ' + m[2] + ' | ' + m[3],
|
label: 'Vagrant | v' + version + ' | ' + os + ' | ' + arch,
|
||||||
version: m[1],
|
version: version,
|
||||||
os: m[2],
|
os: os,
|
||||||
architecture: m[3],
|
architecture: arch,
|
||||||
product: 'vagrant'
|
product: 'vagrant'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -43,7 +43,7 @@ description: |-
|
||||||
<h2 class="os-name"><%= pretty_os(os) %></h2>
|
<h2 class="os-name"><%= pretty_os(os) %></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<% arches.each do |arch, url| %>
|
<% arches.each do |arch, url| %>
|
||||||
<li><a href="<%= url %>"><%= pretty_arch(arch) %></a></li>
|
<li><a data-os="<%= os %>" data-arch="<%= arch%>" data-version="<%= latest_version %>" href="<%= url %>"><%= pretty_arch(arch) %></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
Loading…
Reference in New Issue