logo geotelecom.png

Google Tag Manager: How to simplify the insertion of code on your website

In the digital world we live in, technological innovation is advancing so fast that conventional commerce has moved to digital commerce. If you have been one of the first to jump on the bandwagon and you have a e-commerce or are you familiar with the world of Web analyticsthe marketing digital or the CROGoogle Analytics and Google Adwords are two of the most useful tools offered by Google to better manage your business and advertising campaigns.

With these two tools you can keep track of all the interactions on your Web site: number of visitors, duration of visits, number of forms sent, etc. But in order to use these tools, it goes without saying that a previous installation is required.

If you are not a programmer, you may be wondering. "How can I install these codes on my Web site?". If you don't want to depend on developers and don't want to get involved in technical aspects such as FTP servers, integrated development environments, manual modifications of templates and HTML files, or having to meticulously study the operation of your workframe and take the risk of modifying what you shouldn't every time you need to update or insert a scriptGoogle Tag Manager is your best ally!

What is Google Tag Manager?

Google Tag Manager is a  Tag Management Systems (TMS), i.e., a label management tool Google provides for the implementation of tracking tags and conversions on your website.

To be clearer, it is a container in which you can group and manage campaign tracking tags, code snippets or other scripts that you need to implement on your website. without have to manually modify the source code.

Interesting, isn't it? Well, there's more.

What are the advantages of Google Tag Manager?

Google Tag Manager Logo

The main advantage of this label manager is the independence and autonomy that it offers with respect to the Web development department. But in addition to this great advantage, it offers many others:

  • Centralized tag management and code cleanupWhile previously the tags were inserted one by one in the source code of the page, with the implementation of GTM you will only need to insert the container code and you will be able to manage all the tags from its interface.
  • Increased performanceThe scritps of the analysis tools we use will be loaded externally through the GTM's own tool on the server, without increasing the source code and, therefore, will slow down the loading speed This directly affects the user experience and SEO itself.
  • Easy integration with other Google tools.
  • Progressive migration: Installing GTM for tag management in your Web does not imply its exclusive use, that is, tags inserted in the conventional way can coexist with tags inserted through GTM without generating incompatibilities (WARNING! this applies as long as there is no duplication of codes, because if we insert Google Analytics in the conventional way and, later, we introduce a UA tag through GTM, it will collect the data in duplicate).
  • Easy testing and verification of tag operation: Since it has a preview in which we can check if the tags are activated on the desired page, before publishing them.
  • Version control: That is, if we modify our tags and make a mistake, we can always go back and recover the configuration of any version we have previously saved.

Achtung  However, it must be taken into account that, although it is true that it offers independence from developers at a basic level, at more advanced levels, where you work with variables extracted from the Web itself, you will need the help of a programmer.

How can I install Google Tag Manager on my website?

If we have chosen to use this tool to manage the tags on our Web site, it is time to know how to install it. The installation process consists of the following steps:

  1. Create an account on Google Tag Manager with your Google email.
  2. Create an account and a container for your Web site.
    1. From All accountsclick on New account and set the account name:GTM account setup
    2. It is convenient to use a descriptive name for the account, and, for the container configuration, the domain name and the type of device on which the container is to be applied. Generally, the option web type.GTM configure container
  3. Two code snippets will be automatically generated and displayed in a pop-up window:GTM codes
  4. We insert the code snippets in the appropriate places. To do this we can either contact the developer, or we can do the insertion ourselves. In the case of choosing the second option, we will open the file in which the HTML code is generated from the header of our Web (header.php of the theme that is being used in the case of using WordPress).

The first code snippet will be inserted just as high as possible before the closing tag </head>. Within the same document, we look for the opening tag of the <body> and insert the second code fragment right after it.

GTM code insertion in header

  1. Once the code has been inserted, we save the document and update the file on our FTP server (creating a backup copy to be able to revert changes if there are any errors).

NOTE: This will be the single manual gearbox that we should do about the source code.

  1. Once we have installed the GTM code in your header.php file, we can check if it works correctly with the help of the Google Chrome Tag Assistant extension.

If when you activate the extension and load the page it detects the GTM tag but displays it in yellow and returns error 404, don't be alarmed. It means that it is correctly installed but no version has been published to the container yet. As soon as you add a tag and publish the changes, everything will be working correctly and you will start seeing data in your AdWords and Analytics accounts.

If you managed to install GTM following our little guide and want to know how to insert the Google Analytics tracking code, there will be a post about it soon, so stay tuned to our blog and, if you have any questions, do not hesitate to contact us!

How useful did you find this content?

Click on a star to rate!

Average score 4.8 / Counting of votes: 4

So far, no votes. Be the first to rate this content.

Share

Subscribe to our newsletter!

Don't worry, we won't fill your inbox with dozens of emails. Every month we compile the latest news from the digital marketing sector and send them to you. 

    geotelecom white.png
    logos partner4.png
    european union logo small2.png
    text unioneuropea english.png
    texto innovation english.png
    en_US