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

Commit

Permalink
Fixed bug where analytics.js was not loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
metalshark committed Jan 4, 2014
1 parent aac7114 commit 25c9d33
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ module.exports = (grunt) =>
mainConfigFile: '<%= pkg.temp %>/main.js'
out: '<%= pkg.temp %>/optimized.js'
optimize: 'none'
findNestedDependencies: true
findNestedDependencies: false # Does not work with this enabled

# grunt-contrib-watch: https://github.com/gruntjs/grunt-contrib-watch
# Run predefined tasks whenever watched file patterns are added, changed or deleted.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Installation via bower
```json
{
"dependencies": {
"requirejs-google-analytics": "~0.1.7"
"requirejs-google-analytics": "~0.1.9"
}
}
```
Expand Down
13 changes: 12 additions & 1 deletion dist/GoogleAnalytics.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ <h2 id="installation">Installation</h2>
<p>Installation via bower</p>
<pre><code class="lang-json">{
&quot;dependencies&quot;: {
&quot;requirejs-google-analytics&quot;: &quot;~0.1.7&quot;
&quot;requirejs-google-analytics&quot;: &quot;~0.1.9&quot;
}
}</code></pre>
<h2 id="usage">Usage</h2>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "requirejs-google-analytics",
"description": "Google Analytics loader",
"version": "0.1.7",
"version": "0.1.9",
"scripts": {
"test": "grunt travis --verbose"
},
Expand Down
14 changes: 13 additions & 1 deletion src/GoogleAnalytics.litcoffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Strict helps to trap more potential bugs.

'use strict'
Load
[Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
using requirejs.
Feel free to just use this snippet for a lightweight implementation.

require.config
paths:
'ga': '//www.google-analytics.com/analytics'
shim:
'ga':
exports: 'ga'
`module` is used to retrieve the
[configuration](http://requirejs.org/docs/api.html#config-moduleconfig) and
[EventEmitter](https://github.com/thomaswelton/bower-event-emitter) is used
Expand Down Expand Up @@ -39,7 +51,7 @@ Set the chosen variation for the Visitor for
unless @config.ga
# Load the actual Google Analytics library
require ['//www.google-analytics.com/analytics'], (@ga) =>
require ['ga'], (@ga) =>
@fireEvent 'ready', @ga
else
@ga = @config.ga
Expand Down

0 comments on commit 25c9d33

Please sign in to comment.