joshdvir / google-analytics-turbolinks Goto Github PK
View Code? Open in Web Editor NEWUse google analytics with turbo links
Home Page: http://shukydvir.github.com/google-analytics-turbolinks
License: MIT License
Use google analytics with turbo links
Home Page: http://shukydvir.github.com/google-analytics-turbolinks
License: MIT License
Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Bundler now generates gems with a default 'MIT' license. There is even a License Finder
to help companies ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.
If you need help choosing a license, github has created a license picker tool
How did I find you?
I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for gemspecs not specifying a license as a public service :)
So far it's going pretty well.
I've written a blog post about it
If you're using gtag.js, this gem won't work, because the pageview needs to send the analytics ID. I'm not sure if it's possible to add this functionality to this project.
https://developers.google.com/analytics/devguides/collection/gtagjs/pages
gtag('config', 'GA_TRACKING_ID', {
'page_title' : 'homepage',
'page_path': '/home'
});
Sorry to ask a silly question, but what GA snippet do i use for this?
The regular Snippet at the bottom of the body tag like this:
<script>
(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),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-xxxxxxx-2', 'auto');
ga('send', 'pageview');
</script>
Won't that double count full page loads?
Hi,
To use this gem, should I include the Google Analytics snippet in the body tag or can I have it in the head tag?
According to the solution suggested in http://reed.github.io/turbolinks-compatibility/google_analytics.html, the snippet has to be moved to , so I was wondering whether the same applies to this gem.
Thanks
How would GA tracking be restricted to production only using this system?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.