mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Update Google analytics token handling.
This commit is contained in:
parent
2618a6e7d5
commit
c686ced77f
|
@ -1,11 +1,16 @@
|
||||||
@(gaToken: String)
|
@(gaToken: String, gpu: Boolean)
|
||||||
@if(gaToken != null) {
|
@if(gaToken != null) {
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||||
|
@if(gpu) {
|
||||||
|
ga('create', '@gaToken', 'auto', 'gpu');
|
||||||
|
ga('gpu.send', 'pageview');
|
||||||
|
} else {
|
||||||
ga('create', '@gaToken', 'auto');
|
ga('create', '@gaToken', 'auto');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
@if(!offline) {
|
@if(!offline) {
|
||||||
@if(!serverPrinting) {
|
@if(!serverPrinting) {
|
||||||
@if(gpToken) {
|
@if(gpToken) {
|
||||||
@GoogleAnalytics(gpToken)
|
@GoogleAnalytics(gpToken, false)
|
||||||
}
|
}
|
||||||
@if(ssm.hasGAToken()) {
|
@if(ssm.hasGAToken()) {
|
||||||
@GoogleAnalytics(ssm.fetchGAToken())
|
@GoogleAnalytics(ssm.fetchGAToken(), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user