• Home
  • Get help
  • Ask a question
Last post 1 hour 11 min ago
Posts last week 81
Average response time last week 44 min
All time posts 70348
All time tickets 10857
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#10849 – 4SEO Google Analytics V4 Code Slowing Down Website - PageSpeed Insights.

Posted in ‘4SEO’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Sunday, 25 February 2024 23:57 UTC
WebsiteWI

Does 4SEO need to be connected to Google Analytics?

The reason I asked is it is slowing down the website with according to the google pageside insights.

I do have it in my template BUT I use lazy loading code.

Monday, 26 February 2024 08:24 UTC
wb_weeblr

Hi

Does 4SEO need to be connected to Google Analytics?

4SEO is not connected to Google Analytics.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Monday, 26 February 2024 17:16 UTC
WebsiteWI

4SEO   >  Configuration > Analytics > Screenshot

 

Monday, 26 February 2024 17:25 UTC
wb_weeblr

Hi

4SEO > Configuration > Analytics > Screenshot

Well you added the Google analytics snippet using 4SEO.

4SEO itself is not connected to Analytics, nor does it do anything with or in connection to analytics.

What this rule does is inject in your page the standard Google analytics code snippet, that you get from Google. You could inject that as well in your template for instance.

I do have it in my template BUT I use lazy loading code.

Yes, of course, 4SEO injects the standard, lazy loaded code.

Can I ask why you are using both?

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Monday, 26 February 2024 17:50 UTC
WebsiteWI

Hi Yannick,

Okay so I'll turn off Google analytics in 4SEO. 

RE: Can I ask why you are using both?  I setup 4SEO last year this year I changed and optimized new templates for better Google PageSpeed Insight scores.   It was recommend to lazy load Google Analytics for faster load times which worked.

Thanks, Best Regads

Bill

Monday, 26 February 2024 17:57 UTC
wb_weeblr

Hi

It was recommend to lazy load Google Analytics for faster load times which worked.

There's only one recommended way to load the Analytics V4 snippet. It's using an async attribute and therefore does not slow down the page. In other words, nothing is being slowed down by this and there's nothing more to do:

<head>
<script class="4SEO_analytics_rule_1574" async src="https://www.googletagmanager.com/gtag/js?id=G-[redacted][redacted]"></script>
<script class="4SEO_analytics_rule_1574">
    window.dataLayer = window.dataLayer || [];function gtag() {dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'G-[redacted][redacted]');</script>

I'm not sure exactly what you mean by lazy loading here but using the proper v4 snippet does not trigger Page Speed at all. 

Also, and in case you're doing for better actual performance, google pageside insights is not what Google uses for measuring speed.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Monday, 26 February 2024 23:04 UTC
WebsiteWI

Hi Yannick,

So, what does Google use to measure speed?

Thanks, Best Regards

Bill,

Tuesday, 27 February 2024 08:12 UTC
wb_weeblr

Hi

So, what does Google use to measure speed?

Your visitors Chrome browser: https://developer.chrome.com/docs/crux

If I use chrome on my phone, and I am in a tunnel with a slow phone from 2012, and I visit your site, you will get a low score, because the page took 10 seconds to load.

Page Speed Insights or the tools in your browser developer tools page are only here to help you identify what's slow and what's fast.

GoogleBot, their crawler, does not measure speed.

And again, back to the topic at hand, I don't know what code you are using and call "lazy" but using the async attribute will not block the page rendering while the script is being downloaded nor its rendering, so there's really not much you can do to avoid any impact on the page than using the async attribute. Which is why this is the recommended way to load that script (or any other that's not used for rendering the page)

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Friday, 29 March 2024 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.