+49 69 83008980 service@xqueue.com
Benötigen Sie Hilfe?

Im Maileon Help-Center finden Sie umfassende Dokumentationen zu unserem System.

Beliebte Suchanfragen: Importe | Rest-API | Integrationen | SMS

Google Tag Manager

Sie sind hier:

 

Maileon Analytics using Google Tag Manager

 

Description

 
Google Tag Manager (in short GTM)
is an easy to use method to integrate and maintain Scripts (or code
in general) into a website.
Without using GTM, a script that needs to be added to all, or maybe only specific pages, needs to be added
to the template(s), usually requiring an agency to make this change, deploy and test it.
With GTM, the GTM script is once included in the basic template and can dynamically load scripts that are
managed in a central place. Thus, the website has to be changed only once and for systems like Shopware,
there are even easy to install plugins that do this with a few clicks.
This document describes how to use such a plugin for Shopware 5 and how to integrate a basic conversion
tracking using Maileon Analytics. Basic knowledge for using GTM and also Maileon Analytics is assumed.
 

Preparing Shopware

 
The easiest way to include GTM into Shopware 5 is to use the plugin “Google Tag Manager + Enhanced E-Commerce Tracking für Shopware 5”.
Thus, the first step is to download, install and activate the plugin. Follow the installation instructions and
enter the container ID that you are going to use. If you do not have a container for Shopware, create it in
your GTM account.
 

 
The container ID can e.g. found in the overview of your GTM account:
 

 
Once entered and saved, make sure to clear your Shopware cache!
 

Preparing Maileon Analytics

 
In your Maileon account, create a analytics page and page objectives as usual. Make sure your objective
contains the proper URL marker, e.g. in Shopware with regular checkout this will be ‘*checkout/finish*’.
 

 
Download and copy the JS code from the analytics page as this code needs to be added to GTM in the
next step.
 

Preparing Shopware

 
This document assumes you already created a container and only shows how to integrate the MA code
including submission of the cart value on order complete page.
The elements required to set up everything may vary from customer to customer but in this document,
we show a rather simple approach by using two different tags and a single data layer variable.
The first tag is the generic MA Script that is to be added to all pages except the final order confirmation
page. The reason is rather simple: on the confirmation page we want to also submit a value. While this
can probably be done in a single script, this guide is for beginners and uses two different tag definitions.
Thus, the first page, will be called “Maileon Analytics General” and will be of type “User defined HTML
tag”. It will be included in all pages except “checkout/finish”. Here the MA script will have to be
provided with variable “val” just being empty.
 

 
The second tag will be called “MA – Submit Conversion (Cart Value)” and will be added only, when page
“checkout/finish” is shown. Here, we will add a variable for “val” to submit the cart value.
 

 
In the example we used variable {{dlv – order total}} so this needs to be defined, next.
A variable of type “datalayer variable” is added:
 

 
The value has to be set to “ecommerce.purchase.actionField.revenue”, if not redefined elsewhere.
If this value is correct can be investigated for example by using a browser debug console and checking
variable “dataLayer” on the order confirmation page (after submitting the order):
 

 
This should be everything, so the changed tags need to be published in GTM.
 

Checking Results

 
The first thing to check is if the MA script is loaded and the order value is added. Simply make an order
and check the sourcecode of the page. Easiest way is to search for something like
“MaileonAnalyticsObject” in the elements browser and search from there the “val=” assignment
 

 
If everything went well, the value of “val” and the number in the order should be the same.

When testing from a mailing, please remember: test mails will not trigger setting the tracking cookie, so
conversions are not counted. Make a real send out to test users, then conversions should be submitted
to Maileon and added to the mailing.

Inhaltsverzeichnis