- This topic has 87 replies, 3 voices, and was last updated 2 years, 9 months ago by
David.
-
AuthorPosts
-
November 15, 2022 at 11:51 pm #2417570
Kris
btw. I just talked to Hostgator and they do not support WebP images on my account. Bummer!
November 16, 2022 at 12:02 am #2417574Fernando Customer Support
It seems you’re still using the Google Tag Manager Tracking codes. If you want to use just Analytics, you’ll need to hook only that instead.
I believe the code should look something like this: https://share.getcloudapp.com/OAu29O2k
Hook it to
wp_head
. This link as mentioned shows how to get the tracking code: https://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/I’m not sure if All-in-one SEO manages Google Analytics as well. I don’t think it does inherently.
I see. Yes, some hosting providers do disallow next-gen images, and only allow them for higher-level subscriptions/service.
November 16, 2022 at 12:24 am #2417585Kris
OK, shall I go into Analytics and set up a brand new Google Analytics 4 property?
…and then install it as a Hook.Also I found this in the AIO SEO settings:
<!– Google tag (gtag.js) –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=G-Y4RPSRBC6T”></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘G-Y4RPSRBC6T’);
</script>That seems to be the one we are trying to get rid of.
November 16, 2022 at 12:29 am #2417588Fernando Customer Support
I see. Glad you found that.
Yes, you can set up a new Analytics Property and then hook it.
I think you can remove the other ones you’ve created afterwards.
November 16, 2022 at 12:45 am #2417601Kris
OK. I found these instructions https://support.google.com/analytics/answer/9744165
Should I follow those, or create a new one instructed here https://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/
November 16, 2022 at 1:12 am #2417623Kris
OK. I did the Hook. Could you please go and see if it’s done correctly? It think it is the new GA4 property as it has that G-Y4RPSRBC6T in thje code.
November 16, 2022 at 1:20 am #2417638Fernando Customer Support
Yes, it looks good. You can remove the other two hooks previously created for Google Tag Manager. If you haven’t removed the one from All-in-one SEO, you can remove it now as well.
Then, just wait maybe 24-48 hours and test if it works. Reference: https://support.google.com/analytics/answer/9333790?hl=en
November 16, 2022 at 7:11 pm #2418898Kris
Hi Fernando,
I removed the analytics code from All-in-one SEO, but which hooks do you mean?
Yesterday we created the google tag manager header and footer hooks in order to get that j.defer=true there.
I assume we still need those? Additionally to those two, we only have the analytics hook there, so 3 in total.I just ran Lighthouse, and it’s looking pretty good! https://i.postimg.cc/Y0XBdQrN/Lighthouse.jpg
We still need to fix some render blocking resources -issues.
Also, please see the top 3 in DevTools https://i.postimg.cc/2yqNXVVP/Chrome-Dev-Tools2.jpg
Line 1 is the analytics.
Line 3 is the new one I created in tag manager to get the code manually to the site for that j.defer=true -fix.Thank you for your support! I could not do this without you, mate!
-Kris
November 16, 2022 at 10:15 pm #2418999Fernando Customer Support
Yes, I’m referring to the two Google Tag Tracking codes we added previously. These two:
G Tag Manager head
andG Tag Manager Body
.If you only need Analytics, I think the GA4 tracking code you added latest would be sufficient as mentioned in the articles I shared.
Or, if you want Google Tag Manager, you can do away with the Analytics code. I think having only Analytics should be better performance-wise though.
Glad that it’s performing better now! You’re welcome Kris!
November 16, 2022 at 10:38 pm #2419020Kris
I definitely don’t want the Google Tag Manager there. As you said those google tags have been causing the problems.
You said we have to do those two Hooks manually so we tell google NOT to access the site. Hence the modification we did: j.defer=true
I’m a bit confused…November 16, 2022 at 11:26 pm #2419052Fernando Customer Support
Yes, we can remove those.
We only added
j.defer=true
for better performance in case you still want to use Google Tag Manager. Since GA works without GTM, you can theoretically remove the first two codes we added. See: https://measureschool.com/google-analytics-vs-google-tag-manager/#:~:text=You%20could%20install%20your%20Google,Pixel%20or%20Adobe%20Analytics%20Tag.Doing so could make your site perform better.
November 17, 2022 at 5:10 pm #2420621Kris
OK, I have now deteled the two Hooks. Performance jumped up a few points in Lighthouse.
In DevTools however, I’m still seeing one GoogleTag: https://i.postimg.cc/T1NdC3MS/chromedevtools.jpgI found it in the source code:
<!– Google tag (gtag.js) –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=G-Y4RPSRBC6T”></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘G-Y4RPSRBC6T’);
</script>How can we get rid of this?
November 17, 2022 at 6:19 pm #2420671Fernando Customer Support
That’s your GA4 tracking code. It’s added through a Hook Element. You shouldn’t remove that. Otherwise, your analytics won’t work.
I can see that it has indeed improved upon retesting.
I would suggest trying using a CDN as well as mentioned previously. This may help improve the performance of the site.
November 17, 2022 at 7:38 pm #2420708Kris
OK, good to know. I deleted the GA4 tracking code Hook Element for now, as I will need analytics only after I we have some good URL’s in the Search Console. I will put it back then if that actually happens. Fingers crossed!
With that, we got now GREEN across the board in Lighthouse. Woohoo! https://i.postimg.cc/L4VnJj5y/Lighthouse2.jpg
It’s also gone from DevTools, obviously: https://i.postimg.cc/dQWZW8Fh/Chrome-Dev-Tools4.jpg
In that screen print we can see that the WP Fastest Cache is the biggest now. Would you recommend using a different Cache plugin?
… also in the screen we see ajax.googleapis thingy. Is the something we can do about that?
Re. CDN I might try out the free Arvan Cloud https://www.arvancloud.com/en/pricing/cdn It’s free up to 100GB. Do you think it would work good for the site, or can you recommend another free service?
November 17, 2022 at 7:49 pm #2420718Fernando Customer Support
That’s normal with regard to Caching plugins. It’s already serving a minified version. I’m not sure if using a different plugin will result better, but in essence, it will just theoretically do the same.
With regards to
ajax.googleapis
are you using anything Google related still? An example would be fonts.I’m not sure about that specific CDN. I find that most of our customers use Cloudflare. It might be good to ask in our Facebook page for suggestions: https://www.facebook.com/groups/1113359788719597
-
AuthorPosts
- You must be logged in to reply to this topic.