Manage Javascript Code On Your Blog In A Better Way Using Google Tag Manager

Google Tag Manager, another awesome tool from Google’s arsenal can be used to manage javascript snippets on your website in a better and more efficient way. Your site could contain multiple javascript snippets like – For Eg: Google Analytics code, alexa’s Analytics code etc. With Google Tag Manager you can organize all these codes in one place which will be much easier to manage and also you wouldn’t need any more technical knowledge than just a free hand to copy-paste some codes.

google-tag-manager

 

Although this tool has been around since 2005 but i think not manypeople are utilizing it to increase their productivity. This is the reason which tempted me to write this post on – How To Setup And Manage Google Tag Manager.

So What Is A Tag ?

A tag (in reference to Google Tag Manager) could be defined as javascript snippet which sends information from your site to third-party applications like Google Analytics, Adwords, Crazy Egg etc.

Google Tag Manager operates around three main elements: Tags, Rules and Macros.

  • Tags = A tag is HTML code that executes (or fires) on a page.
  • Rules = Specify when a tag should be fired such as when a specific page is loaded or in response to an action on the page.
  • Macros = a pre-defined set of conditions that allow rules to be executed.

Why You Need It ?

With so many different codes on your webpage it becomes bloated and bogs down on speed. With Google mentioning in clear words that How Speed Is Now A Ranking Factor, It could very well throw your site among the one’s being penalized. This being the biggest factor but apart from that it also provides a peace of mind while managing different codes just from a single place.

How It Works ?

Google Tag Manager works via its own container tag that you place on all your website pages. The container tag replaces all other tags on your site, including tags from AdWords, Google Analytics, Floodlight, and 3rd party tags. Once the Google Tag Manager container tag has been added to your site, you update, add, and administer additional tags right from the Google Tag Manager web application.

How To Implement It ?

To Implement Google Tag Manager on your site follow these simple steps :-

Setup An Account :

Creating a Tag Manager account is easy, you just need to sign-in here with your Google Id and you are good to go.

Create A Container For Your Website :

If you have multiple websites it is better to create multiple containers for each of them so that it will be easy to identify.

Add The Container Snippet Code To Your Website’s Source Code :

Once you have successfully created your account and a container for your website, you will be presented with a container code which you need to add to your site’s source code. This should not be big task for an average user as you just have to copy and paste the code.

Create Tags For Javascript Codes On Your Website :

The next step is to create separate tags for every different javascript code on your website. For Example – If you have codes for Google Analytics, Adwords And Crazy Egg then you need to create different tags for each of them.

Publish The Tags :

Lastly, the tool will show you a preview of what you have just setup and you can click Publish.

Remove The Javascript Code From Your Website :

Now that you have created the tags on your Google Tag Manager account and implemented the container code on your website – you don’t need your old javascript code for Google Analytics and other snippets on your website, remove them and your site should now be much lighter as compared to earlier.

Conclusion :-

Using Google Tag Manager at first could seem like a lot of work but while looking at the big picture i.e., now that you don’t have to change multiple codes for a minor change at different places would make you blessing Google for this awesome tool.

So, Have you moved to Google Tag Manager yet? How did you find the transition?

4 thoughts on “Manage Javascript Code On Your Blog In A Better Way Using Google Tag Manager

  1. AKASH GOLA says:

    Hi Aditya Singh,
    Very good article, you really write very well. I am great fan of your blog, keep writing.
    Thanks for sharing.

  2. FirstAida says:

    I have noticed you don’t monetize your page,
    don’t waste your traffic, you can earn extra
    cash every month because you’ve got hi quality content.
    If you want to know how to make extra money, search for: Boorfe’s tips best
    adsense alternative

Leave a Reply

Your email address will not be published. Required fields are marked *