How to install Google Analytics 4 on WordPress (manually WITHOUT plugins)
HTML-код
- Опубликовано: 10 сен 2024
- This video shows you how to generate google analytics code for a website and how to add google analytics 4 to WordPress.
Link to the script: sorendrimerpej...
Thank you for such a straight forward explanation. SO many videos push plugins. Thank you!
Thank you. Happy to be of service
Thank you for the very clear video straight to the point. I will next search your other videos if there are instructions to add more functionality to GTM - this was such a great video!
Thank you so much. That’s was a nice comment. Made my day 👌🏻🙏🏻 I’m glad to be of service
Really Helpful, As SEO Specialist i know each and every part in SEO And ranked many ENYERPRISE LEVEL WEBSITES. But, honestly working with coding is bit confusing part for me, Thanks For The Help, i get to know the things very well. Liked...
Thanks a lot 👌🏻🙏🏻
Brilliant teaching. Thanks a lot!
You're very welcome!
Helped me get through a tough time. Thanks
Glad it helped!
Thanks a lot! Really clear explanations. Greetings from Barcelona!
Thanks. I’m glad I could help
Brillant
Thanks
I'm getting an error message when i try to add the code: "Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP."
Hi there! It sounds like you're encountering a common WordPress security feature designed to prevent changes that could potentially break your site. This feature checks for errors in PHP code before saving changes, and if it detects a possible error, it reverts the changes to avoid crashing your site.
Here's what you can do:
Check the GA4 Script: Make sure the GA4 script you're trying to add is correct and doesn't contain any syntax errors. Even a small mistake can cause WordPress to reject the change.
Use a Plugin: Consider using a plugin designed for inserting headers and footers scripts. This can be a safer and easier way to add the GA4 script without editing theme files directly. I uses "Header and Footer Injection"
Contact Your Hosting Provider: If you're still having trouble, your hosting provider's support may offer insights specific to your hosting environment.
Remember, it's always a good idea to back up your site before making any changes.
Best of luck /Soren
Enlightening video, thanks a ton !
I’m glad I could help 👌🏻
Thanks Soren, It helped with your kind guidance. Thanks a lot.
Glad to hear that. Thanks 🙏🏻
Does it happen instantly like that? I added the code manually just like you did (and made sure my personalized code was there twice) and Google Analytics said it wasn't detected.
Yes. Usually within a couple of minutes. Also, make sure your browser doesn’t have cashed version. Try adding a ?1=2 after you url. That might do the trick
turns out I just needed to wait a bit. Thanks!
@@MayaPerry1 👌🏼👍🏼
cannot find option theme editor,its just not there.what should i do?
No. Some themes don’t make it obvious. You can either go directly to the file editor at your host or opt for the plugin “header and footer injection” and put it there. The latter is the easiest
This is awesome. Thank you so much for this!
Thanks. I appreciate it
I don't use WordPress theme but Laravel phpscript. It does not have header.php Do you have an idea where to put the code in my file manager?
I’m not to familiar with Laravel so I could be wrong, but I believe you would add the code to a Blade layout file. located in the resources/views/layouts directory and might be named app.blade.php or master.blade.php. Adding a HEAD section in there. Best of luck
@Thanks a lot. It works! You can consider making a new video for some of us who use phpscripts. It can save many people from a lot of stress. Really appreciate your support.
@@aayisah7985 that’s a great idea. Thanks
@ can you help me add user id to GA4. I want to see individual user properties on GA4. Do I need to add another line of code in master.blade.php?
Excellent ....
Thanks 🙏🏻
Hej, tak for en super god video. Jeg har indsat koden lige som du forklare, men analytics tracker fortsat ikke. Jeg har tænkt om fejlen kan have noget at gøre med, at jeg også har et plugin der hedder elementor header and footer, som jeg bruger som header og footer på min hjemmeside, og at koden måske skal indsættes i dette plugin på en måde?
Hej. Tak for de pæne ord 🙏🏻 Ja. Det er en mulighed, og værd at prøve af. Dog vil jeg tro at Elementor ligger som Child Theme og derfor er sekundær i rækkefølgen.
Jeg har et par gange kommet til at slette et enkelt tegn i script koden ved en fejl. Så virker den ikke. Der ville jeg nok starte
Send mig evt et screenshot af det på Messenger hvis du vil
jeg har dobbelttjekket koden og den skulle stå skrevet korrekt. I analytics, når jeg trykker på "test dit website" så skriver den "Google-tagget blev ikke registreret på dit website" @
mine do not have theme editor. how do i do this then? pls help
You can either access the file via you host or use a small plugin called “header and footer injection”
Useful things :)
Glad you think so!
i dont have theme editor option and dont know where to find it. i only know how to use the code editor for each page
Some themes do not allow for easy editing inside Wordpress. Your options then are to use the file editor at you hosting company or using a plugin like “Header and Footer Injection”. Hope that helps
the script is not available
No. You’re right. The SSL certificate is broken. Thanks for letting me know. I’ll fix er straight away
The site is back online. Thanks for the heads up