简体   繁体   中英

Google analytics reporting zero seconds sessions

I tried to figure out why do I have so many Google analytics report of zero seconds sessions. Finally I understand that my script function below is being identified as a popup window. Can anybody help me to figure out what coud cause that? I look at a Powermapper that reported that there is a popup being blocked in my webpage. I did not inserted any intentional popup inside my webpage.

why are you adding your google analytics code inside another function? Google provides the analytic code for you to insert as the first item on the head of the webpage like the following:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=USER_PROPERTY_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'USER_PROPERTY_ID');
</script>

The only thing that you need to add Google Analytics is to place those 2 script tags on the head of every web page and replace the USER_PROPERTY_ID with your own UA-XXXX-XX value.

Best Regards, Rafael

After reviewing my webpage I founded that there is one script code that I placed in my webpage related to the SSL company. Seems that this script code is opening a popup on mouse scrow. I do not know why I never realize that before but seems to be fixed according to Powermapper. I will continue to monitor google analytics results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM