You can use the Plugin in combination with our Mapp Intelligence Google Tag Manager template.
With 3 easy steps you can accomplish basic tracking and even e-commerce tracking in case you use Woocommerce:
- Install and configure the Mapp Intelligence Plugin in Wordpress
- In Google Tag Manager, create a trigger and the variables
- In Google Tag Manager, install our Mapp Intelligence template and map the variables
This guide will lead you through those steps.
A) Install Mapp Intelligence in Wordpress
- Log in to your Wordpress backend, click on Plugins > Add new.
- Search for 'Mapp Cloud' and click the 'Install Now' button.
> Afterward, under 'Plugins' you will see 'Mapp Cloud' in your side menu.
- Click the entry and you will see the configuration. You can now choose 'Google Tag Manager'.
At 'Google Tag Manager Container ID' you have the option to enter your Container ID. Do this if you want the Mapp Intelligence plugin to load the GTM code snippet in the head of your Wordpress website. If you already load the GTM Snippet through your theme or another plugin, you can keep this field empty.
You can find the Container ID in the corresponding column of your container overview in Google Tag Manager (GTM-XXXXXXX).
If you do not want to have certain data in the dataLayer, you can exclude those keys under 'Exclude keys'.
You can exclude Wordpress users from tracking. If you activate this option, admins, managers, editors or anybody being logged into the admin console will not be tracked by Mapp Intelligence anymore. However, Woocommerce customers will still be tracked.
Once done, click 'Save Changes' and the configuration within Wordpress is finished.
B) Trigger and variables in Google Tag Manager
Now log in to your GTM Account and go into your container.
First, we add a trigger by clicking Triggers > New > Choose trigger type > Custom Event and enter as the event name:
You can also name the trigger, here we call it "mapp.load" too.
Now we create variables. In the tables below you can see which data you can expect to be pushed by the Mapp Intelligence plugin.
To create the variable for the pageName, you need to click Variables > New > Choose variable type > Data Layer Variable. Again you can name the variable however you want, but the value for 'Data Layer Variable Name' needs to fit the entry in the table below. For the sake of consistency, we call both of them "mapp.pageName" here:
Now click the 'Save' button and continue with all data you want to track.
General Wordpress data
Data Layer Variable Name
|mapp.contentCategory||Values can be page, post, product, etc.|
|mapp.contentSubcategory||Values can be: single-page, single-post, category-post etc.|
|mapp.customerId||In case the user is logged in, here is the md5 hash of the email address.|
|mapp.customFields||This key is blacklisted by default. Here you can find data from your plugins and themes, and some of them might contain personnel data. That's why this key should only be whitelisted if you really need certain data from your plugins/themes in your data layer.|
|mapp.internalSearch||On search result pages only: search term.|
|mapp.language||Language code. Since the underlying Smartpixel tracks the language automatically this is not needed normally.|
|mapp.numberSearchResults||On search result pages only: the amount of search result as a string.|
|mapp.orderBy||On archive pages only. "default" if no particular order is set.|
|mapp.pageName||URL without the http(s) protocol URL parameters|
|mapp.pageNumber||On archive pages only.|
|mapp.pageTitle||Title of the page.|
|mapp.taxonimes.taxonomieName.N||Object with taxonomies. By default, Wordpress comes with two taxonomies: category and tags. Categories are sorted from lowest to highest level, so if you'd want to map the lowest category level, you'd use "mapp.taxonomies.category.0". If you'd want to map the second tag, you would use "mapp.taxonomies.post_tag.1". Plugins and Themes might add additional taxonomies that will show up here if there are values available for the current post/page.|
|mapp.userRoles.0||Array of user roles names. For the first use.0, if there is a second one use mapp.userRoles.1 etc.|
Woocommerce product tracking
There are many keys containing product data. However, when using the Google Tag Manager template and its underlying Smartpixel, all you basically need is 'mapp.gtmProductArray'. Inside that variable, you'll find all product data without the need to bring it to the right structure. You will learn in step 3 how you can customize the tracking information.
Structured product data (recommended)
Data Layer Variable Name
|mapp.gtmProductArray||Array containing all product information in perfect structure for usage in conjunction with our Google Tag Manager template and its underlying Smartpixel.|
|mapp.pageRequestType||Populated with value 'virtual' when adding a product to basket via AJAX (product lists, related products...). The first trackrequest is a product view, the second one the add-to-basket. This way you never have products added to basket without being viewed. Use this parameter to filter out views that have no 'real' view and just exist for the sake of data consistency. Can be used as a page parameter for example.|
|mapp.shoppingCartStatus||"view" on single product page, and right before adding a product to basket from product lists. "basket" when adding to basket, and "confirmation" after order. This is needed when using the Mapp Intelligence Product Array variable template (see below).|
Raw product data (only needed in edge cases)
Under normal circumstances, you won't need those because the tracking is covered by mapp.gtmProductArray. Only use the following keys in case you have an edge case where you need a specific entry. However, for Mapp Intelligence product tracking the variables mapp.gtmProductArray and optionally mapp.shoppingCartStatus as well as mapp.pageRequestType will be all you need.
Data Layer Variable Name
|mapp.productName||Human-readable title of the product.|
|mapp.productCost||Cost of the product.|
|mapp.productId||Woocommerce ID of the product.|
|mapp.productQuantity||Amount of products.|
|mapp.productSoldOut||'1' in case product is sold out.|
|mapp.productCategory||Highest level of product categories.|
|mapp.productSubCategory||2nd level of product categories.|
|mapp.productCategories.N||Array with all product category levels - in case you have more than two levels, you can use this. For example, if you want to map a level 3 category, you can do this with "mapp.productCategories.2". The Index is always one value lower than the level of the category.|
|productCollection||1 is the product is a product group, 0 for all other product types.|
|mapp.taxonomies.taxonomyName[n]||Contains product taxonomies as well as attributes for variable products, for example, mapp.taxonomies.pa_color is the color of a product.|
|mapp.products||Array with all products from product lists. Each object has the keys like a normal product (productName, productCost etc.).|
Woocommerce order tracking
Data Layer Variable Name
|mapp.orderId||Woocommerce Order ID.|
|mapp.totalOrderValue||Order value, incl. tax and shipping.|
|mapp.subtotalOrderValue||Order value without tax and shipping.|
|mapp.taxValue||Tax of order.|
|mapp.couponValue||Value of a coupon, if available.|
|mapp.shippingMethod||Name of the shipping provider.|
|mapp.shippingCost||Shipping cost for the order.|
|mapp.paymentMethod||Name of the payment provider.|
|mapp.currency||Currency code (ISO 4217).|
C) Configure Mapp Intelligence GTM template
Now that we have all the data available, it is time for the final step: installing the Mapp Intelligence template tag and mapping the data.
- Click Tags > New > Choose type > Community Template Gallery > Mapp Intelligence Smartpixel - Tracking Configuration > Choose Template
- Name the tag. Here we call it "Mapp Page Tracking"
- Let's add out trigger first: scroll down to the bottom of the tag configuration, and click 'Choose trigger to make this tag fire...'. Pick the trigger from above, in our example "mapp.load".
- Now map the data. For example, if you want to map the pageName value from the Wordpress Plugin to the page name in Mapp Intelligence, just map it like this:
- Now all you need to do is to enter basic information like your Track ID and Track Domain, save the tag, publish the container and you will have basic tracking.
E-commerce with Woocommerce
In this chapter we want to have a closer look at how you can add and customize product- and order tracking within Woocommerce.
For basic e-commerce tracking, all you need to map is this:
Now you will track orders, product views, and products being added to the basket. The product ID, which is the central identifier for products in your tracking data, will be in this format: "[productID] - [productName]". However, within the "gtmProductArray" there are more tracking data available than it is used by this very basic configuration.
Here is an overview of what is included in the basic configuration, and what else is available:
|property name||tracked via basic configuration||notes|
|product id||id||yes||Format: [productID] - [productName], example: "18 - T-Shirt".|
|product cost||cost||yes||Quantity of product is taken into account, so two $5 products will track a price of $10.|
|product quantity||quantity||yes||Amount of products. Unusually 1 when views, but can be more when adding to basket or during order.|
|product status||status||yes||"view", "basket" or "confirmation".|
|product id only||id_only||no||just the id of the product, without the name|
|product name||name||no||just the name of the product, without the id|
|product SKU||sku||no||SKU of product|
|is product collection||collection||no||Map this to a multi-value e-commerce parameter so you can filter products of type 'group'. A product of type 'group' can never have a full conversion, because only the child items, e.g. the products within that group, can be bought. 1 means it is of type 'group', 0 for everything else.|
|product taxonomies and attributes (variable products)||taxonomy_name_N||no|
All taxonomy and attribute (→ variable products) values, with N as the number of the value. For example, if you have a product with the categories "Music", "Jazz" and "Acid", you'll have the entries:
So the key names depend on your product and shop settings. Find out your values by using the GTM preview mode or have a look at your dataLayer via browser JS-console. In the dataLayer array, look for the entry with the event 'mapp.load', and then under gtmProductArray.
Advanced product tracking
You can further customize the product tracking and use the additional information that is available in "mapp.gtmProductArray".
To do that, you first need to create a new variable. Click variables → New → Choose type → Community Template Gallery → Mapp Intelligence Product Array
Add the variable template to your container and open the configuration.
If you then map Product array to mapp.gtmProductArray and Product status to mapp.shoppingCartStatus, and map the new variable, that we call "Enhanced Product Array" here, to the product array entry in the main Mapp Intelligence Template, you are back to the basic setting but you have the option to customize it now.
In your Enhanced Product Array, you can now map the additional values to product categories (static values) and e-commerce parameters (dynamic parameters).
For example, the SKU value is a static value, meaning it is always the same for a product. So it is a perfect value to map to a product category. All you need to do is to add it to the corresponding table. So if you'd want to add the sku as product category 3, you would do it like this: enter the is number in the left column, and the property name (see table above) in the right column:
A typical example for dynamic values are attributed in variable products. Let' map e-commerce parameter 20 to the pa_color_0 taxonomy:
If you now save and publish your settings, the additional data will be tracked if it is available in a product.