multi-analytics-turbolinks 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +56 -0
- data/Rakefile +1 -0
- data/lib/assets/javascripts/baidu-tongji-turbolinks.js.coffee +7 -0
- data/lib/assets/javascripts/bing-uet-turbolinks.js.coffee +8 -0
- data/lib/assets/javascripts/google-analytics-turbolinks.js.coffee +12 -0
- data/lib/multi-analytics-turbolinks.rb +6 -0
- data/lib/multi-analytics-turbolinks/version.rb +7 -0
- data/multi-analytics-turbolinks.gemspec +22 -0
- metadata +73 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 446e2c2f167c15dc4e2c1d5063c4f28a3b291afe
|
|
4
|
+
data.tar.gz: 82c45162b857e51a6ced7a00fc40f6298eb34ce4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e131dd8276aa7b2ed97b3e1345e6c83a0fa1bfdf9ca6df8962e5a802e96d17a332910571737a7d5dacc2848633a5afb123cc11a95a4a0c76d7b0e50e7cbf41ef
|
|
7
|
+
data.tar.gz: 890fcb6824c47f8f3d85f97b717b88a011f53004f7e3398f04dc773916cd46c50878a18d84d7b7bb39e58c160d889b8cffff730e175c8180802be5580547fa53
|
data/.gitignore
ADDED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.3.1
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2012 Shuky Dvir
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Multi::Analytics::Turbolinks
|
|
2
|
+
|
|
3
|
+
Turbolinks page changes are often not detected with event tracking frameworks such as
|
|
4
|
+
Google Analytics, Baidu Tongji and Bing UET.
|
|
5
|
+
|
|
6
|
+
Facebook's Pixel appears to work with turbolinks without problems.
|
|
7
|
+
|
|
8
|
+
These analytics and ad/event tracking products are also the
|
|
9
|
+
worlds largest search providers. This gem adds support to fire these
|
|
10
|
+
events on page changes, to more accurately work with turbolinks.
|
|
11
|
+
|
|
12
|
+
This gem was forked from joshdvir's google-analytics-turbolinks
|
|
13
|
+
|
|
14
|
+
**Use with Rails and Asset Pipeline**
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Add this line to your application's Gemfile:
|
|
19
|
+
|
|
20
|
+
gem 'multi-analytics-turbolinks'
|
|
21
|
+
|
|
22
|
+
And then execute:
|
|
23
|
+
|
|
24
|
+
$ bundle
|
|
25
|
+
|
|
26
|
+
Or install it yourself as:
|
|
27
|
+
|
|
28
|
+
$ gem install multi-analytics-turbolinks
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Signup to
|
|
33
|
+
|
|
34
|
+
* [Google Analytics](http://analytics.google.com/)
|
|
35
|
+
* Baidu Tongji [join](http://tongji.baidu.com/open/api/more?p=howToJoin) and [login](http://tongji.baidu.com/web/welcome/login)
|
|
36
|
+
* [Bing UET](https://secure.bingads.microsoft.com/) (credit-card not required)
|
|
37
|
+
|
|
38
|
+
Add the JS you need to your Javascript manifest file (typically application.js)
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
//= require google-analytics-turbolinks
|
|
42
|
+
//= require baidu-tongji-turbolinks
|
|
43
|
+
//= require bing-uet-turbolinks
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Contributing
|
|
47
|
+
|
|
48
|
+
1. Fork it
|
|
49
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
50
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
51
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
52
|
+
5. Create new Pull Request
|
|
53
|
+
|
|
54
|
+
##License
|
|
55
|
+
|
|
56
|
+
Check LICENSE, MIT.
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
if typeof Turbolinks != 'undefined' && Turbolinks.supported
|
|
2
|
+
eventName = if typeof Turbolinks.controller != 'undefined' then 'turbolinks:load' else 'page:change'
|
|
3
|
+
document.addEventListener eventName, (event) =>
|
|
4
|
+
|
|
5
|
+
# Baidu Tongji
|
|
6
|
+
if window._hmt != undefined
|
|
7
|
+
_hmt.push(['_trackPageview', window.location.pathname + window.location.search])
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
if typeof Turbolinks != 'undefined' && Turbolinks.supported
|
|
2
|
+
eventName = if typeof Turbolinks.controller != 'undefined' then 'turbolinks:load' else 'page:change'
|
|
3
|
+
document.addEventListener eventName, (event) =>
|
|
4
|
+
|
|
5
|
+
# Bing UET
|
|
6
|
+
if window.uetq != undefined
|
|
7
|
+
window.uetq.pageLoadDispatch = false
|
|
8
|
+
window.uetq.push("pageLoad")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
if typeof Turbolinks != 'undefined' && Turbolinks.supported
|
|
2
|
+
eventName = if typeof Turbolinks.controller != 'undefined' then 'turbolinks:load' else 'page:change'
|
|
3
|
+
document.addEventListener eventName, (event) =>
|
|
4
|
+
|
|
5
|
+
# Google Analytics
|
|
6
|
+
if window.ga != undefined
|
|
7
|
+
ga('set', 'location', location.href.split('#')[0])
|
|
8
|
+
ga('send', 'pageview', {"title": document.title})
|
|
9
|
+
else if window._gaq != undefined
|
|
10
|
+
_gaq.push(['_trackPageview'])
|
|
11
|
+
else if window.pageTracker != undefined
|
|
12
|
+
pageTracker._trackPageview();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'multi-analytics-turbolinks/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |gem|
|
|
7
|
+
gem.name = "multi-analytics-turbolinks"
|
|
8
|
+
gem.version = Multi::Analytics::Turbolinks::VERSION
|
|
9
|
+
gem.authors = ["Jonathon Padfield"]
|
|
10
|
+
gem.email = ["jonathon.padfield@gmail.com"]
|
|
11
|
+
gem.description = %q{This gem adds support for turbolinks to Google Analytics, Baidu Tongji & Bing UET tracking code. This gem is forked from the google-analytics-turbolinks gem.}
|
|
12
|
+
gem.summary = %q{This gem adds support for turbolinks to Google Analytics, Baidu Tongji & Bing UET tracking code.}
|
|
13
|
+
gem.homepage = "https://github.com/trammel/multi-analytics-turbolinks.git"
|
|
14
|
+
gem.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
gem.files = `git ls-files`.split($/)
|
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
gem.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
gem.add_development_dependency("rake")
|
|
22
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: multi-analytics-turbolinks
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.9
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jonathon Padfield
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rake
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description: This gem adds support for turbolinks to Google Analytics, Baidu Tongji
|
|
28
|
+
& Bing UET tracking code. This gem is forked from the google-analytics-turbolinks
|
|
29
|
+
gem.
|
|
30
|
+
email:
|
|
31
|
+
- jonathon.padfield@gmail.com
|
|
32
|
+
executables: []
|
|
33
|
+
extensions: []
|
|
34
|
+
extra_rdoc_files: []
|
|
35
|
+
files:
|
|
36
|
+
- ".gitignore"
|
|
37
|
+
- ".ruby-version"
|
|
38
|
+
- Gemfile
|
|
39
|
+
- LICENSE.txt
|
|
40
|
+
- README.md
|
|
41
|
+
- Rakefile
|
|
42
|
+
- lib/assets/javascripts/baidu-tongji-turbolinks.js.coffee
|
|
43
|
+
- lib/assets/javascripts/bing-uet-turbolinks.js.coffee
|
|
44
|
+
- lib/assets/javascripts/google-analytics-turbolinks.js.coffee
|
|
45
|
+
- lib/multi-analytics-turbolinks.rb
|
|
46
|
+
- lib/multi-analytics-turbolinks/version.rb
|
|
47
|
+
- multi-analytics-turbolinks.gemspec
|
|
48
|
+
homepage: https://github.com/trammel/multi-analytics-turbolinks.git
|
|
49
|
+
licenses:
|
|
50
|
+
- MIT
|
|
51
|
+
metadata: {}
|
|
52
|
+
post_install_message:
|
|
53
|
+
rdoc_options: []
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubyforge_project:
|
|
68
|
+
rubygems_version: 2.5.1
|
|
69
|
+
signing_key:
|
|
70
|
+
specification_version: 4
|
|
71
|
+
summary: This gem adds support for turbolinks to Google Analytics, Baidu Tongji &
|
|
72
|
+
Bing UET tracking code.
|
|
73
|
+
test_files: []
|