A Quick Guide on Adding Multiple Google Tag Manager Containers In a Single Android App

📢 Tatvic is now a global partner of Usercentrics, world’s leading consent management platform

A Quick Guide to Adding Multiple Google Tag Manager Containers In A Single Android App

Last Updated:

Services:    

 

Introduction

If you work with Android Apps, you know for a fact that there are situations where you might want to add multiple Google Tag Manager (GTM) containers. One of our clients was in this very situation and an added problem that they were facing was that their GTM container was full.

We were now facing a situation where we had to remove the extra tags and triggers, but this fixed the problem only for a short time. Hence, my team and I were determined to find a long-term solution for this which could be helpful for other clients and Google Tag Manager users like you as well. We started off by trying to add multiple Google Tag Manager containers at once, and guess what? It worked like magic!

This blog post is an ultimate guide that’ll help you add multiple containers inside your Android Application.

Implementation

I assume that you already have one Google Tag Manager container installed as per How to implement Google Tag Manager for Android.

To add the second container, follow the below three steps:

1. Download the binary file from the new Google Tag Manager container as below:

     Inside GTM, Go to the Versions tab-> Action -> Download.

Image 1: Downloading the binary file from the new GTM container

2. Add the downloaded file to the raw folder.

Image 2: Adding downloaded file to raw folder

3. Create an object of PendingResult with a new Google Tag Manager id and call setResultCallBack in your Application Class.

Image 3: Creating an object of PendingResult

Now, you can get the following DataLayer Singleton anywhere in the application :

Make sure that you use the same Data Layer object across your Application.

Now you can push any dataLayer event for both containers. The only thing you need to take care of is to check whether both containers do not contain the same tags. If that’s the case, then, 2 similar tags will be fired even though you push the event only once.

Conclusion

In 3 simple steps, you will be ready to use the second container for tracking the events. When compared to the web, app implementation is simpler since you do not need to add the new container snippet on all the screens.

We hope this blog post proved to be a useful guide to you. We would love to hear from you if you have any feedback for us or even if there are any workarounds that you might have derived. Tell us all about it in the comment section below.

Click here to know more about our Google Analytics Audit Solutions. Feel free to reach out to us in case you need any assistance with Google Tag Manager.

Picture of Jitendra Verma

Jitendra Verma

Jitendra Verma is working as campaign manager in Tatvic. He has been running successful digital marketing campaigns for the top e-commerce giants.

Sign up for
our monthly newsletter

This field is for validation purposes and should be left unchanged.

Other Blog

Scroll to Top

Leverage Tatvic's comprehensive approach to 

Enquire Now

This field is for validation purposes and should be left unchanged.

Leverage Tatvic's comprehensive approach to 

Contact Us

Checkbox
This field is for validation purposes and should be left unchanged.