Skip to content
This repository was archived by the owner on Oct 17, 2020. It is now read-only.

Commit 25c9d33

Browse files
committed
Fixed bug where analytics.js was not loaded.
1 parent aac7114 commit 25c9d33

6 files changed

Lines changed: 29 additions & 6 deletions

File tree

Gruntfile.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module.exports = (grunt) =>
189189
mainConfigFile: '<%= pkg.temp %>/main.js'
190190
out: '<%= pkg.temp %>/optimized.js'
191191
optimize: 'none'
192-
findNestedDependencies: true
192+
findNestedDependencies: false # Does not work with this enabled
193193

194194
# grunt-contrib-watch: https://github.com/gruntjs/grunt-contrib-watch
195195
# Run predefined tasks whenever watched file patterns are added, changed or deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Installation via bower
3030
```json
3131
{
3232
"dependencies": {
33-
"requirejs-google-analytics": "~0.1.7"
33+
"requirejs-google-analytics": "~0.1.9"
3434
}
3535
}
3636
```

dist/GoogleAnalytics.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ <h2 id="installation">Installation</h2>
135135
<p>Installation via bower</p>
136136
<pre><code class="lang-json">{
137137
&quot;dependencies&quot;: {
138-
&quot;requirejs-google-analytics&quot;: &quot;~0.1.7&quot;
138+
&quot;requirejs-google-analytics&quot;: &quot;~0.1.9&quot;
139139
}
140140
}</code></pre>
141141
<h2 id="usage">Usage</h2>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "requirejs-google-analytics",
33
"description": "Google Analytics loader",
4-
"version": "0.1.7",
4+
"version": "0.1.9",
55
"scripts": {
66
"test": "grunt travis --verbose"
77
},

src/GoogleAnalytics.litcoffee

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ Strict helps to trap more potential bugs.
77

88
'use strict'
99
10+
Load
11+
[Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
12+
using requirejs.
13+
Feel free to just use this snippet for a lightweight implementation.
14+
15+
require.config
16+
paths:
17+
'ga': '//www.google-analytics.com/analytics'
18+
shim:
19+
'ga':
20+
exports: 'ga'
21+
1022
`module` is used to retrieve the
1123
[configuration](http://requirejs.org/docs/api.html#config-moduleconfig) and
1224
[EventEmitter](https://github.com/thomaswelton/bower-event-emitter) is used
@@ -39,7 +51,7 @@ Set the chosen variation for the Visitor for
3951
4052
unless @config.ga
4153
# Load the actual Google Analytics library
42-
require ['//www.google-analytics.com/analytics'], (@ga) =>
54+
require ['ga'], (@ga) =>
4355
@fireEvent 'ready', @ga
4456
else
4557
@ga = @config.ga

0 commit comments

Comments
 (0)