Using a PHP Code snippet to insert a Google Tag

In this video I created on YouTube (https://www.youtube.com/watch?v=BX-rrmJhUgU), I showed 5 different methods how to install the Google Tag into your WordPress website.

One of which is using a piece of PHP Code to install it directly into your site.

Unfortunately, YouTube didn’t allow me to paste the code into the description as it doesn’t allow the symbol < or > in the description so I made this blog post to paste the example code for anyone who might need the code example.

Without further ado !

//Add Google Tag To my Website
Function my_google_tag_code(){ ?>


/* Put you Google Tag Here !! */


<?php
}
Add_action ( ‘wp_head’ , ’my_google_tag_code’ , 10 );

Enjoy!!

Other Articles

Building Mr Beast’s Feastables Website In WordPress | GSAP Elementor Tutorial

So if you follow along in the video, I refer to this blog post for you to enter code at ...

Building Peter McKinnon’s Website In WordPress

All Images used for the website tutorial: Download Images Please guys, these images are just to help copy the style ...

Never Seen Before – Animated SVG mask entrance effect for images in elementor

https://youtu.be/VduaRoRBuzM So if you follow along in the video, I refer to this blog post for you to enter code ...

GSAP Button Magic Elevate Your Elementor Button Hover Effects

https://youtu.be/CXxqXMzj4_k So if you follow along in the video, I refer to this blog post for you to enter code ...