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

Move analytics to a module #454

Merged
merged 1 commit into from Mar 30, 2015
Merged

Conversation

adamlofting
Copy link
Contributor

Hey @toolness - I moved this analytics code out to an npm module https://github.com/adamlofting/react-ga/ so we can use the same logic in other projects.

The module itself could do with test coverage, but I'll follow up with you separately on that task.

@@ -50,7 +51,8 @@ exports.generateStatic = function(url, cb) {
};

exports.run = function(location, el) {
ga.initialize();
var options = { debug: false };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can actually set debug to process.env.NODE_ENV != 'production' here, yay!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, that debug thing is quite verbose. Perhaps we should just add a GA_DEBUG env var, and if it is on then we set that flag to true.

@toolness
Copy link
Contributor

This looks good to me! You can change the one suggestion I made or just push it, up to you.

toolness added a commit that referenced this pull request Mar 30, 2015
@toolness toolness merged commit 0e3d919 into mozilla:develop Mar 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants