Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where should i add DocHead.loadScript? #23

Open
Mindgames opened this issue Nov 14, 2015 · 1 comment
Open

Where should i add DocHead.loadScript? #23

Mindgames opened this issue Nov 14, 2015 · 1 comment

Comments

@Mindgames
Copy link

Trying to add DocHead.loadScript but can't get it to work. Could you please tell me where and how to add this in a Flowrouter-srr stack

var gaScript = 'https://www.google-analytics.com/analytics.js';
DocHead.loadScript(gaScript, function() {
    // Google Analytics loaded
    ga('create', 'UA-XXXX-Y', 'auto');
    ga('send', 'pageview');
});

Made a good effort myself to get it to work. Asked on Meteor forum, Stackoverflow, Tons of Google & and even searched through all github repos after some repo that used it in it's code, But nothing...

Putting up good examples would make the biggest difference, saving time for both users and on your part eliminating loads of questions.

@SachaG
Copy link

SachaG commented May 17, 2016

I don't think it matters where you add it. But as far as I can tell, this only works on the client, meaning it will not be SSR'd. I might be wrong though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants