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

usage ? #5

Open
epsylon76 opened this issue Jul 21, 2018 · 4 comments
Open

usage ? #5

epsylon76 opened this issue Jul 21, 2018 · 4 comments

Comments

@epsylon76
Copy link

im trying to include analytics with <script> tags but no luck,
what is the usage ?

@nickvergessen
Copy link
Member

Your code is put into: $(document).ready(function() { <<<yourcodehere>>> });

@snomisneb
Copy link

Hi Nick,

I'm sorry but I don’t understand how this Nextcloud-app works.
I would like to use Google Analytics and pasted the Google tracking script in the Jsloader-app, but the code doesn’t show up on any page?
Is there something I’m doing wrong?

@jdillard
Copy link

jdillard commented Oct 25, 2018

I'm curious if there is a working example of using Google Analytics as well. The standard snippet given from Google won't work. I think I got close with a work around, but I am now having issues with being limited to only put one domain in the CSP policy whitelist.

EDIT: I was able to get it working without using Google Tag Manager. You can try the following code at your own risk, just replace UA-XXXXXXXX-X with your ID and add www.google-analytics.com to the CSP Policy field:

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('send', 'pageview');
ga('set', 'anonymizeIp', true);

@polargeex
Copy link

So it's work with this for analytics but I don't find script to have a working version with google tag manager

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

5 participants