Google Tag Manager (GTM) Implementation

This page offers comprehensive instructions for implementing the InMobi CMP on a website using Google Tag Manager (GTM). This process uses a custom HTML GTM tag and additional GTM variables and triggers/trigger groups. Before finalizing your GTM setup, complete the site and consent configurations. 

Assumptions

  • You have an InMobi CMP account with your website added and configured.
  • The website where InMobi CMP will be added has GTM installed.
  • This guide assumes that you import the provided GTM container file into your GTM environment to import the custom HTML tag and necessary variables and example triggers. (For help on Variables, check out our Variables Guide.) It is recommended that you import & merge the provided container into your existing container, creating a new workspace; see the instructions below.

Things Needed

Add Choice with GTM (JSON Container Import)

Importing the GTM InMobi Choice TCFv2 container is the most reliable way to add the custom HTML tag, all of the necessary variables, and sample triggers you can use to configure your container for consent management easily.

Download the GTM Container Import - Tag and Variables. Store it in a local directory on your computer.

  1. On the Google Tag Manager user interface, click Admin in the top navigation.
  2. In the Container column, click Import Container.

  3. In the view that opens, click Choose container file.
  4. In the file selector, browse the GTM-CONTAINER-IMPORT.json file in your local directory and select it for importing.
  5. Choose to create a New workspace with the import or to merge it into an Existing workspace. It is recommended to create a new workspace for this import.
  6. In the overlay that opens, give the workspace a descriptive name.
  7. Click Save in the top right corner to save the new workspace.
  8. Choose Merge as the import option, and select Overwrite conflicting tags, triggers, and variables.
  9. Verify that the import options are all fine. You can click View detailed changes to see what will happen when you confirm the integration.
  10. Click Confirm when ready to import the container to the new workspace you created.

You have now added all the necessary tags, triggers, and variables to get you started. You will have to configure some variables, and you will have to create new triggers to enable consent management in the container. The next chapter will explain this process in more detail. 

InMobi CMP GTM Configuration

Here are the steps you need to take to configure the InMobi CMP web tag, and to create and modify the triggers and variables you’ll need for the integration to work.

  1. Set the InmobiChoice - UTID constant value. Browse Variables in your container, and open up the InmobiChoice - UTID variable. Set the value to your UTID (pCode).
  2. If subdomains are not selected, this value is False by default. Otherwise, a valid domain should be entered.

Enable CCPA Support

  • You must have CCPA enabled on the website add at choice.inmobi.com/protect.
  • You need an html container with a unique ‘id’ attribute set (likely in the footer) where the CCPA message will be appended to on the page.
  • You can learn more about the html id attribute here.
  • This html id can be anything you choose (valid html id value) as long as the container id (on the page) matches the InmobiChoice - CCPA msg id value in GTM. In the screenshot below the container in the footer of the website has the id of ‘choice-footer-msg’ and since we also set the value of InmobiChoice - CCPA msg id in GTM the CCPA footer message was appended to the container with JavaScript. You may need to have your dev team add an empty container (with a unique html id) to the footer of your website where the CCPA message can be appended.
  • Add the InmobiChoice - CCPA msg id constant value. This is the html id of the footer dom element where the CCPA message/popup link will be appended. (See the explanation above about how to find/get an HTML id attribute).
  • Set the InmobiChoice - CCPA constant to true to enable, false to disable.
  • If CCPA is successfully enabled on your website you will see the CCPA msg with a link Do Not Sell My Data link in the footer (or wherever your html id div from step 2 a is located on the page). 
  • When clicking on the Do Not Sell My Data link in the CCPA footer message a modal should pop up.

Push consent signals to the data layer

Set the InmobiChoice DataLayer Push constant to true to automatically push consent signals for IAB Vendors, Non-IAB Vendors, Legitimate Interests, and Publisher Consents. 

On This Page

Last Updated on: 13 Feb, 2024