How to set up and use the MVMCloud Analytics Tag Manager
The first step in configuring the MVMCloud Analytics Tag Manager is creating a container. A container represents a website MVMCloud Analytics, when a website is created a container for this website is automatically created.
Tags, Triggers, Variables and code set versions can be created within each container.
To access the Tag Manager panel, click on the Tag Manager menu located at the top of the Tag Manager main page. MVMCloud Analytics. In the image below you can see the panel with the Default Container, created during site creation:
Embedding Tag Manager code on your website
The code generated by Tag Manager needs to be added to your website pages so you can easily add new ones tags, triggers and variables on your website, without having to code each one.
Finding the embed code
To find the code to embed the container on your site, log into MVMCloud Analytics and click Tag Manager at the top of the page. You will now see a list of containers for the selected site. You have two options:
- Select "Manage Containers" and click the "Installation Code" icon on the right next to a container, or;
- Select a container and click "Install code".
Another option is:
- You can find the code by going to "Administration >> Tracking Code". However, you will only see JavaScript code for environments that currently have a published version. If you just created a container and haven't published (deployed) any versions to an environment, you won't find the installation code there;
When you click on the installation code icon `` a window will open and you can see the code to be incorporated into your website:
This code needs to be added to the <head>
tag of each page on your website.
A simple installation will only require a Live environment. However, if you are working on sites where security and stability are critical, you will probably need to add a development and staging environment. Choosing any of these three options will result in a slightly different container tracking code:
- Live - Production environment;
- Dev - Development environment;
- Staging - Test environment.
Whichever option you choose, all you need to do is copy/paste this snippet of code as high as possible on your website. Generally, you will want to copy the code to the Live environment.
Using multiple containers
The MVMCloud Analytics Tag Manager allows you to embed multiple containers at once. This can be useful when, for example, Different people manage different containers, and you need to incorporate them all. For example, a team manages all related containers Ads and another team manages all other tags.
To use both tags, simply copy the two codes embedded on your website, preferably one directly followed by the other.
Using the same container on multiple sites
MVMCloud Analytics tag managers support using the same container across multiple sites. The container will still be stored on a website in the Tag Manager interface. To use the same container on multiple sites, simply embed the code on your sites.
Loading a container from your website
When a user is visiting your website, the container will be loaded via the MVMCloud Analytics URL. Sometimes a MVMCloud Analytics URL may be blocked, for example, by privacy or ad blockers, causing the container to not load. If you want to reduce the likelihood of this, you can download the file JavaScript and upload it to your website's server. The downside is that the debug/preview feature won't work out of the box and you will always need to refresh the JavaScript file whenever you publish a new version to an environment.
To download JavaScript from a container, simply open the URL at g.src='https://{$MVMCLOUD_ANALYTICS_URL}/js/{$CONTAINER}.js' and save the file by clicking "File => Save as" in your browser.
Manage Tags
A tag is a snippet of code that can be run on your website. Most of the time, a tag can be used to send data to third parties (e.g. tracking data) or to embed third-party content on your website (e.g. social widgets or surveys). You can add as many tags as you want and a tag will be executed as soon as the condition of a connected trigger is met.
To create a new tag
Select the tag you want to include in the container, for example “MVMCloud Analytics”, to embed the tracking code MVMCloud Analytics on your website through Tag Manager:
Configuring a tag
Tag configuration consists of three main parts:
- A section where you configure the tag itself and what it should do or how the tag should behave, for example, you can configure a MVMCloud Analytics tracking URL or your Google Analytics property ID . The form fields available in this section differ from tag to tag.
- A section where you configure when this tag should be executed (or blocked). This is done by assigning a so-called trigger. Only when such a trigger is being fired will the tag be executed.
- Advanced settings that allow you to configure, for example, how often the tag should run, limit the date range in which the tag should run, and more.
1 – Configuring a label
As each tag represents a different solution: MVMCloud Analytics, Google Analytics, Facebook conversion pixel, remarketing tag, etc. each configuration panel is different according to the selected tag. Some can be very complete and consist of several fields, as is the case with MVMCloud Analytics, while others, such as the custom HTML tag, will only need one field to be filled in.
2 – Configure when a tag should be executed
When you copy/paste the default JavaScript tracking code from MVMCloud Analytics, it sends the data to the MVMCloud Analytics server on each page view. This behavior can be problematic in some situations, for example, certain pages must be crawled under conditions where it is user consent is required.
You can configure when a tag should be executed through Triggers. If you're not already familiar with a tag or trigger manager, we recommend that you read the Triggers guide to understand this concept.
3 – Advanced settings
Some users may require complex configuration, such as defining the number of times a tag should be triggered, the order in which tags should be triggered, and even on what specific start date a tag should be triggered and finished.
A mere example could be a remarketing campaign where cookies will be set until a specific end date. This is exactly what the settings are for advanced features were designed:
Congratulations, you've just set up your first tag! However, the tag still won't load on your site as it is missing some more important steps: