Encyclopedia of Internet Marketing: What is Google Tag Manager and how to use it. Google Tag Manager: tracking referrals to affiliate links What is Google Tag Manager

Google Tag Manager lets you customize and deploy tags, including those for Google Ads, Google Analytics, and Floodlight, as well as third-party tags. To use Tag Manager, follow these steps:

Account – highest level hierarchy in Tag Manager. As a rule, one account is enough for a company. Your Tag Manager account has one or more containers. There are types of containers for websites, AMP pages, Android applications and iOS.

How to create an account and container

When you first load a container, you'll be prompted to add a code snippet to your site or get started with Tag Manager within the SDK for your chosen platform. You can snippet the code right away or click OK to do it after setting up the container.

How to add a container to an existing account Installing a container

Web pages

  • Place the top code snippet (starting with ) in a section of the web page. It is advisable to do this as close to the opening tag as possible, but after the dataLayer declarations.
  • Place the bottom code snippet (starting with ) immediately after the tag.

To prevent reactivation, remove any manual tags from your code that were moved to the Tag Manager container.

To prevent unauthorized access to the container, the Tag Manager code snippet uses HTTPS by default.

Greetings, dear friends!

Remember we set up the Metrica counter, then the Google Analytics counter, and went into the site code to place them? For people completely ignorant of HTML, this caused great difficulties. After all, you won’t immediately understand where the or tag is located. This requires certain knowledge. For this reason, most website owners entrust the installation of counters to webmasters or programmers, and even pay money for it. True, small, but still money. You also need to draw up technical specifications (technical specifications), which takes some time.

But the craftsmen from Google solved this problem by creating one very good service. Called Google Tag Manager. The essence of this tool is to simplify the relationship between a person who does not understand webmasters and the site code. That is, you don’t have to get into the code, just use this service.

Setting up Google Tag Manager will take you a few minutes. But in the future, this tool will compensate for the time you spent setting it up. In addition to setting up, I will tell you how to install the Metrics, Analytics and Adwords counter on the site, without crawling around in its internals.

Well, let's start with.

Be sure to read:

Getting started with Google Tag Manager

I think most people reading this tutorial have Google accounts. You can immediately click on “Log in to your account” in the upper right corner. Those who do not have accounts, register.

Well, then, you need to create an account directly in Tag Manager itself. To do this you need to fill out a short form:

Name your account and click “Next”. The next step is to specify the container settings, namely the site address and the location where the container will be used. Since we are working with a website, we select “Website”:

And click on the “Create” button. Google then offers to accept the agreement. Naturally we will accept it:

Immediately after we created an account, a window with the Google Tag Manager code appears. It needs to be installed after the opening tag:

Copy it and install it on all pages of the site. Here's an example of where to install the code:

Google Tag Manager code

If it is not clear to you, you will have to resort to the services of a webmaster. But, believe me, after this you will rarely contact webmasters for trivial matters.

Google Tag Manager Terminology

In order to clarify many points and at the same time sort out everything you need to work with Tag Manager, I decided to give a small list of basic terms. So:

  • The container is the same JavaScript code that needs to be inserted into all pages. It will include all the code that we install using Tag Manager;
  • A tag is, directly, the Google Analytics or Metrics counter code itself;
  • A trigger is a condition that, when met, activates a tag;
Installing a Google Analytics counter

For many people, setting up Google Tag Manager begins with installing the Analytics counter. We are no exception. So:

In a simple way, we installed a Google Analytics counter. As you can see, it's not difficult.

Installing the Metrica counter

Installing the Metrica counter is even easier. We also create a tag and when selecting the tag type, select “Custom HTML”:

Then simply paste the Metrics code into the HTML field:

We assign the same trigger “All Pages”, give it a name and save it. That's all, now we have two counters in one container:

Today you learned how to unload the pages of your website from unnecessary code. You can delete counter codes and leave only the Google Tag Manager code.

As you can see, setting up Google Tag Manager only takes a couple of minutes.

Well, that's all, dear friends. See you soon!

Don't forget to subscribe to blog updates.

Greetings to all! Today we will talk about google tag manager and see how you can customize using this tool. Google tag manager allows you to quickly update tags and code snippets on your website or app. To put it simply, you can configure when and what information you want to send, for example, to Google Analytics.

First, let's look at the interface. Follow the link: https://www.google.ru/tagmanager/

Name the container, select a website, click “create”. Next, we accept the terms of use agreement for the tag manager. After this, we immediately see instructions for installing the code, but if you did not install the code right away, then you can find it later in the “administration” tab:

The workspace also has 5 tabs on the left:

  • review
  • tags
  • triggers
  • variables
  • folders

Now let's look at them in order. When going to “ work area” we are taken to the “overview” tab, which contains general information about our container. In the tags tab we will configure what information we want to send. The triggers tab allows you to set rules that will determine when our tag should fire. In the variables tab we will set what parameters we want to track. Well, the folder tab is needed for convenient grouping of created tags, triggers and variables.

Installation Google code Analytics to the site

The capabilities of a tag manager are quite extensive, but in this article we will consider only simple tasks. To get started, we'll simply install the google analytics code on our site. To do this, go to the tags tab and click the “create” button, come up with the name of our tag, and select the Universal Analytics code from the drop-down menu.

Add the tracking ID and leave the rest of the settings as they are.

Then we move on to selecting a trigger. Because We have not created new rules yet; we will only have 1 available trigger “all pages”, select it and click “save” in the upper right corner. After creation, we definitely need to check how the tag we created works. To do this, we click on the arrow next to the “publish” button and select “preview” from the drop-down menu.

Now we need (necessarily in the same browser) to open our website. At the bottom of the screen we should see the google tag manager panel.

The screenshot shows that our code worked correctly. Those. When the page loaded, visit data was sent to analytics. Once we've checked that our tag is working correctly, we need to exit preview mode and publish the changes.

Setting Bounce Rate in Google Tag Manager

Now that we have installed the analytics code on the site, let's configure it. Just in case, let me remind you that by default, a refusal for analytics is considered to be any visit in which there was no transition to another page of the site or some event was not recorded. However, the time spent on the site does not affect this indicator in any way. For comparison, in Yandex, a visit lasting less than 15 seconds, without transitions and useful actions, is considered a refusal. Now we'll look at how to quickly set up your bounce rate with using google tag manager. To do this, we need to configure sending an event to Google Analytics after a certain time has passed (let's say it's 15 seconds). First, let's create a trigger. Go to the triggers tab and click the “create” button, then come up with a name for the trigger and select the type - timer.

Now we need to set the interval to 15000 (since these are milliseconds), set the limit to 1 (how many times a goal can be recorded per visit). In the trigger condition we set Page url, “contains” and the domain of our site. Select “all timers” so that the trigger fires on all pages.

Click “save” and go to the tags tab. We create a Universal Analytics tag, come up with a name, add a tracking ID, and select the tracking type - “event”. Next, fill out the “category” and “action”; you can do this arbitrarily because we will not use this data, we need the fact of sending the data. Then, the “no interaction” item must be set to “false”.

After that, select the one we created from the list of triggers and click save.

We have a new tag ready and we need to test it again. Go to preview mode, go to the site, wait 15 seconds. As a result, we should see 2 tags.

We return to the tag manager, exit the preview mode and publish the update. All update versions are saved in the tag manager and, if necessary, you can roll back to previous version. I think this information is enough to get started with the tag manager. Good luck!

Good afternoon, readers and guests. In this article we will learn how to configure Google Tag Manager to track referrals to affiliate links in Yandex Metrica and Google Analytics.

The idea of ​​writing arose due to the fact that I installed a banner on my blog with an affiliate link that leads to hosting. And I became interested in which of the visitors to my site clicked on this link, i.e. I wanted to set up goals in Yandex Metrica and Google Analytics in such a way that they reflected the transition from the banner.

On my blog, analytics is installed through Google Tag Manager (Google Tag Manager or GTM). In search of clues about what appropriate settings need to be made in GTM, I scoured the entire RuNet, but I never found an answer. And I found it from an American - his name is Julian Juenemann. Unfortunately, the resource https://measureschool.com, which the author refers to this moment not available.

Google Tag Manager - what is it??

I don’t think it’s necessary to talk in detail about what Google Tag Manager is in this article. There is enough relevant material on this topic on the Internet.

But in simple terms, GTM can be thought of as a kind of container, a kind of container that we install on our website in the form of HTML code. And in this container we can put anything we want. For example, install a counter for any statistics, be it Yandex Metrica or Google Analytics, etc. Set up conversion tracking, transition tracking, and much more.

The “thing” is very convenient, especially if you are working with a client service that you do not have access to via FTP. It is enough to ask the programmer to install this container on the site once and you no longer need to torment your colleague with your technical assignments. And don’t waste several days waiting for him to finally do the job, as has happened many times in my practice. I don’t want to offend programmers, they are busy people and you also need to understand them. But, time is money!

The practical part. How to track referrals to affiliate links. Setting it up Google Tag Manager.

To demonstrate the settings, I created a test site on which I installed a banner that leads to the partner’s site. We will set up tracking of transitions on the bottom banner using Google Tag Manager. We will see transitions in Yandex Metrica and Google Analytics.

Setting up a trigger to track all clicks

This action will allow us to track all clicks made on the site without exception.

  • In the Google Tag Manager interface, go to the “Triggers” tab.
  • Trigger type - “Links only”.
  • The trigger is activated on all pages: “All link clicks.”
  • We write a name, for example “Click on links”.
  • Rice. 1

    We set up a trigger to track transitions to a specific link, in our case an affiliate link
  • Once again go to the tab - “Triggers".
  • Trigger type - “Clicks only”.
  • Next, select the “Wait for tags” and “Error checking” checkboxes.
  • We set the conditions under which our trigger will be activated. First, we indicate the path (domain) of our site - the trigger will fire on all pages of the site. The second condition is that our trigger will be activated only when you click on a specific link, i.e. an affiliate link. See Fig. 2.
  • Rice. 2

    Setting up Google Tag Manager to track events in Google Analytics

    We configure the “Tag” tool so that the completed action - clicking on an affiliate link - is displayed in Google Analytics. The GA code should already be installed on your resource.

  • Tag type - Universal Analytics.
  • Tracking type - "Event".
  • Parameters of tracked events: “Category” - for example, Affiliate Links; “Action” - Click URL; “Shortcut” - Page Path.
  • IN Google settings Analytics by specifying a tracking identifier (GA code).
  • And lastly, add the previously created “Click on Banner” trigger. See Fig. 3.
  • Rice. 3

    All that remains is to publish the settings for them to take effect. Our result is the ability to track conversions made through affiliate links in Google Analytics. And if we now click on the partner’s posted banner, the corresponding event will be displayed in Analytics. See fig. 4.

    Rice. 4

    I decided to write how to set up Google Tag Manager to track conversions in Yandex Metrica in the second part of the article - “Google Tag Manager: tracking conversions via affiliate links. Part 2". To dispel all the questions you have about setting up, I recorded a corresponding video for you. A small bonus awaits you in the video - I showed how to set up a goal for our event in Google Analytics.

    Yulia Khairetdinova was with you

    SEOnews has launched a project for specialists and clients, within which the editors publish educational materials from leading agencies on the market. Ultimately, we plan to release a complete, practical, and up-to-date e-guide.

    ***

    What is Google Tag Manager and how to use it

    The topic is quite hackneyed, you can find on it great amount blogs, articles and video courses. But the purpose of this article is to give maximum understanding to beginners of how and why GTM can be used. Perhaps this article will be found useful even by those who already have experience using GTM in their practice.

    In Internet marketing, there is often a need to add, change and correct various scripts, set up tracking of user actions, etc. If the use of tags is not accompanied by effective management, it can lead to many problems and long implementation times. The abundance of code slows down the site. Unnecessary or incorrect tags can skew results, incur unnecessary costs, and hinder the collection of important data, and changing them again after programmer errors only delays the time before analysis can begin. Finally, adding new tags can take up a lot of valuable time from IT or webmasters, delaying important marketing programs. At the moment, there are several options for solving a number of problems associated with this. Today we will talk about Google Tag Manager.

    What is Google Tag Manager

    Tag manager is a solution from Google that allows you to place scripts on website pages without directly interfering with its code. GTM makes it possible to add and update scripts directly through the web interface, as well as set rules for activating these scripts. Google Tag Manager is a simple, reliable, and free tool. It provides marketers with flexibility in their work, and allows webmasters to focus on the most important tasks without worrying about the little things. This is a solution for marketing specialists, which provides a single interface for managing all tags on the site.

    GTM structure
    • An account is where you can manage your containers.
    • The container is the main and only fragment of JS code that we insert into all pages of the site. It is essentially a tag, but its function is that it serves as a container for all tags.
    • A tag is a small piece of website code that allows you to track traffic and visitor behavior, analyze the effectiveness of advertising on sites and in in social networks, use remarketing and targeting tools for specific audiences, test and improve your site, and perform many other useful tasks.
    • A trigger determines under what circumstances a tag will be executed or blocked.
    • Variables are name/value pairs for which values ​​are passed during operation. They are used both for custom variables and to determine the condition under which the tag will fire.
    Creation and installation

    The first thing you need to do is log in as your existing Google account in google tag manager, if there is none, create a new one.

    IN in this example I will use the web version container.

    We agree to the license agreement

    Next, the interface will display the code, which, according to Google’s recommendations, should be placed on all pages of the site after the tag. In the future it will be possible to view it in the Admin -> Install Google Tag Manager tab

    That's all. Google installation Tag Manager is finished. You need to proceed directly to setting up tags and triggers.

    Structure. How and why to use it. Possibilities

    Let's take a closer look at the general interface of the program.

    Interface elements

    1 - A search element that will help you quickly find a tag, trigger or variable by name.

    2 - Account Status Review

    3 - Calling a list of tags

    4 - List of rules

    5 - List of built-in and user variables

    6 - Create folders to structure tags, triggers and variables

    7 - Quick access to creating a new tag

    8 - Create a note

    9 - Account status, number of tags, triggers and variables, and their status (published or not published)

    10 - History of changes in the contents of the container.

    Google Tag manager has a lot of features, but today we’ll talk about the basic ones that every analyst or marketer needs to be able to use.

    We'll talk about creating the Tag itself a little lower, because... To configure it internally, you will need a little knowledge about what can serve as the rules for triggering a tag and what data we can operate in the configuration.

    In order to configure the necessary conditions for triggering a tag, you must use triggers. They can be created either separately or during the tag setup itself, which is less convenient.

    In the google tag manager interface, you will find that the settings for tags, triggers and variables are in approximately the same order:

    Name -> Type -> Setting -> Rule

    There is no trigger rule for variables; the value will be accepted on all pages of the site. If the value is not defined, the key will be assigned undefined.

    First, let's look at the steps of creating a trigger and variables.

    Go to the triggers tab and click New. Next, you need to come up with a name (if not entered, when saving there will be a notification in which you can enter a clear name for the trigger) and select its type.

    Each type of trigger is used for different purposes. In order to use all the possible functionality for internal configuration of specific trigger parameters, you need to enable the necessary built-in variables on the Variables page. We will talk about them a little lower, but for now let’s look at the existing events.

    Page View is a trigger that makes it possible to run a tag when loading certain pages, loading a window (at 3 stages provided in GTM) or when additional conditions, which can be selected from the list.

    Next, you need to set the rule for this trigger - there can be 2 options - All page views or for a more flexible setting, Some Page Views, where you can specify a specific page or parameter that will trigger the trigger when the page is loaded.

    The next type of trigger is Click. It is used to listen to 2 types of clicks - All Elements and Just Links. As a rule, you can use All Elements to listen to all clicks, but this leads to the need for more specific settings at the Fire On stage. By analogy with Page View, you can create a condition under which a trigger will fire. To use these conditions, you need to enable indicators that relate to Clicks on the Variables tab (later for Forms and History).

    Then, in the list for selecting trigger trigger parameters, you can select id, class, text, and other parameters that need to be taken into account.

    If the necessary built-in variables are not available, you can use custom ones. They can be various types, can have values ​​from different sources (html, cookies) and can be created both on the site, in the form of a dataLayer array, and using Custom JavaScript directly in the Tag Manager interface.

    Custom JavaScript in the form of user variables has truly fantastic capabilities for analysts and marketers - the need to contact a programmer practically disappears.

    After setting up variables, the lists of conditions in triggers will expand. These variables can also be used as Extra options when transferring data to site monitoring and analytics systems in the form of user parameters and variables.

    Triggers for Form and History Change are created in a similar way.

    Custom Event and Timer require special attention.

    Timer is a trigger that makes it possible to create a rule for triggering a tag after some time has passed, for example, to highlight a separate, more involved audience for a resource and run a remarketing code for such an audience.

    You now have access to basic settings for triggers and metrics in GTM.

    Setting a tag is a very important point, because... it's how you publish the script and what trigger rules you assign that will influence the data that the installed product displays. Google Tag Manager already has a number of products available for installation.

    Installation of counters and product tags, the list of which is available in the interface.

    You can view the entire list of tags provided by Google when creating a tag.

    This list is constantly expanding, but if the necessary built-in functionality is missing, you can use the Custom HTML Tag or Custom Image Tag fields

    In most cases, this approach works, but to install some exceptional products, you need to read the supplier's manual or check with support for details.

    Creating the tag itself is a trivial task. We discussed the steps above, and as for the fields, these are most often identification elements of the installed script (id, unique name or name in the product, etc.), which can be taken from the interface of the installed product. When setting up built-in tags, you most often have the option to fill in fields to create additional parameters. Here you can use the indicators that we discussed above by selecting the appropriate one from the list. It is also possible to change the indicator for a product, if it is sent by default, by specifying a new value.

    In order to check the functionality of the installed tag, GTM provides preview and debugging functionality.

    By clicking on this button and then going to the site, you will see an additional console in which a number of tags will be displayed that worked or did not work on this page. You can also view the moment at which the tag was triggered, the reasons for triggering (or not triggering) and the indicators that are used. Once you are sure everything works, click the Publish button.

    A marketer or analyst needs to use Google Tag Manager when:

  • It takes a developer a lot of time to install or test an analytics system, but analysis needs to be done here and now.
  • Setting up retargeting codes takes a lot of time, but the manager already wants to see results.
  • You need to set up a dozen events, and writing specifications for a programmer and interfering with the code takes a few days at best.
  • There is a need to create custom variables and metrics to expand the analyzed data, etc.
  • Using an example, let's look at installing the Google Analytics code.

    First, I advise you to create a custom variable that can be used as a property id for your account.

    Go to the Variables tab, click New and select the Constant variable type.

    We give it the name GA Property and enter our identifier from Google Analytics. Click Create Variable. In the future, these manipulations will make it easier to work with tags.

    Enter the name of the tag, select the required product (if it is not there, you can use Custom HTML), select Google version Analytics, in the Tracking ID field you need to enter your account ID, but since... in the previous step we created a variable with our identifier, we indicate it. Track Type - Pageview by default.

    In the More settings field, you can enter additional parameters that you want to use.

    The most frequently used:

    • The Fields to Set field is used to transfer parameters that are provided in Google Analytics. This can be page (to create your own page name) or &uid for a view with user id, etc.
    • Custom dimensions and custom metrics are used to pass custom variables and metrics to Google Analytics.
    • Ecommerce features is used to configure Enhanced ecommerce. (To transfer data, Enhanced ecommerce uses the Page View tag type for all stages! The Transaction tag type is used only for classic ecommerce.)

    Click Create Tag and follow the steps described before the cases. (Preview -> Publish)

    To set up Events, you need to create an additional Google Analytics type tag and select event in the track type field. We fill in the standard parameters and create a rule for sending an event in Fire On (don’t forget to tick the required variables on the Variables tab).

    A non-standard, but quite common task is to obtain the cid or client id of Google Analytics as a custom variable. This need arises if a company wants to track each visitor separately or send any data through the measurement protocol.

    The peculiarity of this indicator is that it is stored in cookies Google Analytics.

    We have to:

    1. Create a 1st Party Cookie variable named “_ga”

    2. Create Custom JavaScript with the following code

    var cookie = ((ga cookie)).split(".");

    return cookie + "." + cookie;

    console.log("No Universal Analytics cookie found");

    And now how it works: 1st Party Cookie with the name “_ga” returns data in a form similar to GA1.2.475226310.1380715146. Next, Custom JavaScript parses this string and returns cid by removing the first 4 characters from the received data (GA1.2.) and returns a set of numbers (475226310.1380715146), which shows the full clientID of the user.

    This indicator can be used as a custom variable in Google Analytics, just create it in Google Analytics and add it to a tag in the Custom Dimention field with the session parameter and configure the transfer this parameter from GTM to GA.

    Where Index is the variable number from Google Analytics.

    This is a great example of how to get and use variables in Google Tag Manager.

    In conclusion, I would like to say that Google Tag Manager is a very powerful tool that can be used to achieve many goals without the involvement of a developer: from installing codes and setting up analytics systems to A/B testing and more complex tasks.