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

Google API - Analytics code not showing up in page source, thus no data #2518

Closed
SidneyBilliet opened this issue Nov 25, 2015 · 7 comments
Closed
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@SidneyBilliet
Copy link

Inspite having set the UA code in the Google API config settings via the backend, no data is showing up in Analytics. When inspecting the page source there is no analytics script present.

2015-11-25_13h47_26

<script> (function(i,s,o,g,r,a,m){i'GoogleAnalyticsObject'=r;ir=ir||function() { (i[r].q=i[r].q||[]).push(arguments)} ,ir.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'); </script>
@SidneyBilliet
Copy link
Author

Anybody? This is urgent, please

@mazhalai
Copy link
Contributor

mazhalai commented Dec 1, 2015

@SidneyBilliet thank you for reporting, we have created MAGETWO-46264 to investigate.

@mazhalai mazhalai added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development MX labels Dec 1, 2015
@devhn
Copy link

devhn commented Mar 9, 2016

Any news on this?

@vzabaznov
Copy link
Contributor

Hi @SidneyBilliet , seems like issue cannot be reporoduced on fresh magento version, please check it, and if you think that not, feel free to write here or to open new one

@hostep
Copy link
Contributor

hostep commented Jul 1, 2016

We also run into this with Magento 2.1.0

This is caused by the setting: General => Web => Default Cookie Settings => Cookie Restriction Mode => Yes

While it's questionable if this setting should disable outputting the Google Analytics code, you would expect that when you accept the cookie message, the GA code appears on the page. But that isn't the case.

@vzabaznov: I think you should reopen this after you verified my above statement also triggers this bug on a clean Magento installation (which I haven't tested yet).

@gewaechshaus
Copy link

gewaechshaus commented Jul 7, 2016

We can verify that it doesn't work in our case with a composer installed 2.1.0, but setting General => Web => Default Cookie Settings => Cookie Restriction Mode => No does not have any effect...

@JHoyosl
Copy link

JHoyosl commented May 10, 2018

Hi, I have a issue with analytics. When I checked the console, it shows a sintaxys error, becouse missing a " ' ", you can add in block on "code/Magento/GoogleAnalytics/Block/Ga.php" on line 83, there miss a single colon. Hope this help some one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

7 participants