Using a PHP Code snippet to insert a Google Tag

In this video I created on YouTube (, 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 !! */

Add_action ( ‘wp_head’ , ’my_google_tag_code’ , 10 );


Quick! Before it’s Gone!

Quick! Before it’s gone! We know that readers spend about 20 seconds on a page before their minds jump to …

Enter the Dragon!

Give them a taste of something exotic! Every now and then it’s important to surprise your audience with something new …

One at a Time… Nearly There!

With one week left of Winter here in the Southern hemisphere, you may be feeling a little heavy. Let’s not …