Google Tag Manager: we track referrals to affiliate links. Setting up and installing a tag manager Google Tag Manager what

Google Tag Manager is a convenient service for simplifying the management of tags and codes of third-party resources. The webmaster can place the container on the website being developed once, and then other services will automatically add codes.

More videos on our channel - learn internet marketing with SEMANTICA

To understand what Google Tag Manager (GTM) is, let's look at a simple analogy. We all know that to process orders in an online store, food ordering service or taxi, you cannot do without dispatchers. The process of coordinating and ensuring the work of the entire company falls on their shoulders. This Google service performs a similar function. It allows you not to be torn between applications, tasks and programs, but to connect everything together and issue commands centrally.

Today, GTM allows you to install codes for various services and specialized services on your website: Google Analytics, Yandex Metrics, Google maps, social networks, etc. Due to this, it is possible to significantly simplify the process of using third-party resources and increase the efficiency of the Internet resource.
Why do you need Google Tag Manager?

Tags are an important part of pages; they are code fragments. Thanks to them, third-party resources can analyze the site and obtain the necessary information from it. Tags are also used for regular conversion monitoring, effective remarketing and other similar purposes. Modern marketing requires flexible measurement, the ability to track changes made and evaluate their effectiveness. Adjusting tags and managing them is a fairly lengthy task, consisting of several stages. GTM allows you to simplify this process.

How to install Tag Manager and configure it

To start using it, you need to add the Google Manager container to the site. Next, variables are set, then activation conditions (triggers) are configured. Finally, the tags are added to the container. Let's analyze each of the stages.

Adding a Google Manager container

We go into the Google system, namely GTM, and create a personal account here. We configure the container, enter a number of parameters, including the address of the site itself. Next, the system will generate a code that needs to be inserted into your Internet resource. The code consists of 2 parts, the first is placed in the header, and the other at the end of the tag. We save the adjustments made, add a tag/tags, and now publish the container.

Variables

A tag can be activated only if the variable and activation conditions match. The list of variables is presented in the menu section with the same name; they are configured here:

  • Pages. This could be the request source, URL, page hostname, etc.
  • Utilities. These are various events, HTML tag ID name, container type, etc.
  • Errors. These are messages about where errors occurred, etc.
  • Clicks. These are the various details associated with clicks.
  • Story. These are URL fragments, current and previous moments in history, and the source of its receipt.
  • Forms. Here the form definitions, its text, etc. are used.

For a variable to open in the trigger filter, it must first be enabled in the Variables menu.
Triggers in Google Tag Manager

Triggers, as we found out earlier, must correspond to a variable. Triggers are configured in the menu section of the same name; here you need to click “Create” and then select the type. There are 3 varieties in total:

  • Cry. The trigger will register clicks on links located on the resource, or on all clickable elements.
  • View. It automatically starts working after the DOM is ready, the Window is fully loaded, or you navigate to the desired page.
  • Other.

Tags work

Let's look at the functioning of tags on a specific service, for example, Google Analytics. We connect the Internet resource to the system, open the workspace and click on the “Add new tag” item. Set the type to Universal Analytics. Next, we register the identifier; it is displayed in your Google Analytics personal account. Next, in the “Tracking Type” item, put a checkmark next to the “Page View” function. In the triggers section, click “All pages” and save the changes made.

To check the functionality of the tags, use the “Preview and Debug” option. Select this item in the work area, and then open the Internet resource in the browser you are using. If all tags are entered correctly, data about them will be displayed in the diagnostic window.

In some situations it is necessary to use additional settings. They will allow you to arrange tags in a certain order in which they will be activated. If it doesn't matter in what order the tags are activated, you can forget about advanced settings.

Functional

Today GTM solves a wide range of problems, which makes it a universal assistant in the following tasks:

  • To make the functionality of your website even wider, there is no need to insert new containers and web codes into the site; it is enough to place them in GTM.
  • You can now confirm rights to an Internet resource directly through the dispatcher, bypassing .
  • GTM is effective both for monitoring external transitions (via UTM tags) and for tracking internal clicks (via Google Analytics).
  • You can specify how many users followed external links.
  • It is possible to clarify how many refusals were made. Google Analytics cannot accurately determine this parameter, since it does not take into account visitors who viewed only 1 page.
  • You can monitor the number of clicks on widgets and special buttons.
  • It is possible to trace the sources of external traffic.

This is not all the functionality of the resource. It’s best to go through the menu yourself a couple of times, try different features and choose those that are suitable specifically for your resource.

We bring to your attention step-by-step instructions for installing and configuring Google Tag Manager (GTM). Here we will tell you how to connect Google Analytics and Yandex Metrica using GTM.

Google Tag Manager (GTM) is a multifunctional tool that allows you to add tags to a website or mobile application to analyze traffic, conversion and user behavior without interfering with the site’s source code.

In this article we will describe in detail how to create and configure GTM on a website and how to connect Google Analytics and Yandex Metrica without interfering with the site’s source code.

Benefits of GTM

  • You can add and update tags without interfering with the site's source code. You only need to add the Tag Manager code to the site once, and everything else can be implemented in your GTM personal account;
  • Reducing code on website pages;
  • Convenient and easy to use interface;
  • Ease of testing. Preview mode allows marketers to easily check that tags are working correctly;
  • The service is free.

Before moving on to installation, let's look at the definitions:

  • Container is a fragment of JS code that is placed on all pages of the site. The container contains information about tags that are fired as a result of the execution of certain rules specified in triggers and variables;
  • Tag– a fragment of site code that allows you to track traffic and analyze user behavior, conversion, etc. (for example, Yandex Metrica code);
  • determine when to activate the tag in the web container;
  • Variables is a name-value pair that is used in a trigger as a condition under which the tag will fire.

How to install Google Tag Manager on a website

1. Register an account with Google

If you already have a Google account and are signed in, skip this step. If not, log in or create an account.

2. Create an account in GTM

After logging in to Google, you can proceed to creating an account in GTM. Go to the Google Tag Manager page and click on the “Create an account” button, then enter a fictitious account name and click on the “Next” button.

Picture 1

In the window that appears, enter an invented name for the container and select where it will be used. In our case, this is the “Website” button. After that, click on the “Create” button.

Figure 2

Figure 3


3. Add the resulting Tag Manager code to your site

Once you accept the usage agreement, a code window will appear.

Figure 4

Select and copy the code to a txt file. After that, click on the “OK” button at the very bottom of the window that opens.
Next, in the site template file in which you have the block, insert the code from the top block as close to the beginning as possible.

Figure 5

Paste the code from the bottom block directly after the opening tag.

Figure 6

After you complete these steps, click on the “Publish” button in the GTM panel.

Figure 7


4. Test the correct operation of GTM

Next, it is important to check whether you did everything correctly. To do this, you can use the Google Tag Assistant Recordings plugin for the Chrome browser. Install this extension by following the link.

After installation, the Google Tag Assistant icon will appear in the Chrome browser extensions panel - . To check that GTM installed on your website is working correctly, you need to go to your website and click on this icon.

Figure 8

From the screenshot we see that the icon is green, which means that the installation of Tag Manager was successful. If the icon is yellow or red, the tag is placed with errors.
Google Recommendations

Figure 9

Connecting Google Analytics via GTM

Now let's proceed directly to connecting Google Analytics via GTM.


1. Register Google Analytics

If analytics are already installed on the site, you can skip this point. If not, check out how to register Google.Analytics and complete the registration process.

Note! After registering Google.Analytics, you do not need to place the code on the site. We'll only need the Google.Analytics tracking ID a little later. If Google.Analytics was registered earlier and the code is already posted on the site, after connecting Google.Analytics via GTM, the previously posted analytics code can be removed.


2. Log in to your previously registered GTM account and click on the “Add new tag” link

Figure 10


3. Select tag type

In this case, we need Universal Analytics.

Figure 11


4. Specify the site's Google Analytics tracking ID and tracking type - “Page View”

Figure 12

You can view the resource tracking ID in your Google Analytics settings.

Figure 13

5. Specify the “All Pages” trigger

To make the tag fire on all pages, specify the “All Pages” trigger.

Figure 14


6. Save the entered data

Figure 15


7. Specify the tag name and click on the “Save” button

Figure 16


8. Check if the tag is working correctly

To do this, click on the arrow next to the “Publish” button and select “Preview”.

Figure 17

In Preview, the container containing the changes will only be available in your browser.

If the container appeared under the line "Tags Not Fired On This Page", the tag on the page did not fire. It is necessary to check all settings and, if necessary, correct any errors.

If the container appears under the line “Tags Fired On This Page,” it means that Universal Analytics was installed without errors.

Figure 18


9. Publish Universal Analytics

Figure 19

Thus, we connected Google Analytics to the site via GTM without interfering with the source code of the pages.

Connecting Yandex Metrics via GTM

To connect Yandex Metrica, follow the same steps as for Google Analytics, but since by default there is no Yandex Metrica in GTM, when selecting a product, specify “custom HTML”.

Figure 20

As a result, a window with an empty field will appear.

Figure 21

You must insert the code for your Metrica counter into this HTML form.

If Yandex Metrica is already installed on the site, copy the counter code from the page source code. If not, read how to create and configure a Yandex Metrics counter.

Note! As with Google.Analytics, there is no need to place code on the site. When setting up Yandex Metrica, the resulting code must be copied and added to the “Custom HTML” window that appeared at the previous stage.

Figure 22

Before publishing, check that the tag is working correctly by clicking on the “Preview” button.

Figure 23

If in preview mode the container is placed under the line “Tags Fired On This Page”, then everything is configured correctly. If the container is displayed under the line “Tags Not Fired On This Page”, the tag did not work, most likely an error was made during connection.

Figure 24

After we are convinced that the tag worked in preliminary mode, click “Publish”.

Thus, we connected Yandex Metrica to the site without interfering with the source code of the pages.

If you don't already have GTM installed on your site, you can install and configure it by following our instructions. And we, in turn, will continue to write about how to analyze traffic, conversions and user behavior using GTM.

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 tag is or . 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. It's 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 Metrica, 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, please 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 must 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 Metrics 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.

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 a huge number of blogs, articles and video courses on it. 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 websites and social networks, use remarketing tools and targeting specific audiences, test and improve your website, 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 to your existing Google account in google tag manager, if you don’t have one, create a new one.

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 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 Tag Manager installation is complete. 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 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 under additional conditions that 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, All Elements can be used 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 of various types, can have meaning 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 additional parameters 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:

  1. It takes a developer a lot of time to install or test an analytics system, but analysis needs to be done here and now.
  2. Setting up retargeting codes takes a lot of time, but the manager already wants to see results.
  3. 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.
  4. 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 the version of Google 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 Google Analytics cookies.

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 about 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 of 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.

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 the 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, to which the author refers is currently unavailable.

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 everything perfect clicks on the site without exception.

  1. In the Google Tag Manager interface, go to the “Triggers” tab.
  2. Trigger type - “Links only”.
  3. The trigger is activated on all pages: “All link clicks.”
  4. 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

  1. Once again go to the tab - “Triggers".
  2. Trigger type - “Clicks only”.
  3. Next, select the “Wait for tags” and “Error checking” checkboxes.
  4. 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.

  1. Tag type - Universal Analytics.
  2. Tracking type - "Event".
  3. Parameters of tracked events: “Category” - for example, Affiliate Links; “Action” - Click URL; "Shortcut" - Page Path.
  4. In the Google Analytics settings, enter the tracking identifier (GA code).
  5. 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.

I was with you Yulia Khairetdinova