mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Attempt to get Google Analytics working for pushstate
This commit is contained in:
parent
4a806dcb4c
commit
82eaa022f9
@ -38,10 +38,15 @@ $.when($.ready).then(function() {
|
||||
|
||||
// Add page load to brower history
|
||||
window.history.pushState({
|
||||
'href': href,
|
||||
'title': title,
|
||||
'nav': $(html).find('#nav').html(),
|
||||
'content': $(html).find('#content').html()
|
||||
}, '', href)
|
||||
|
||||
// Track on Google Analytics
|
||||
ga('set', 'page', href)
|
||||
ga('send', 'pageview')
|
||||
})
|
||||
})
|
||||
|
||||
@ -53,6 +58,10 @@ $.when($.ready).then(function() {
|
||||
$('title').text(e.state.title)
|
||||
$('#nav').html(e.state.nav)
|
||||
$('#content').html(e.state.content)
|
||||
|
||||
// Track on Google Analytics
|
||||
ga('set', 'page', e.state.href)
|
||||
ga('send', 'pageview')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user