Fahim Fahim - 1 year ago 154
iOS Question

iOS Google Tag Manager Integration: How to add multiple containers per App environment?

I completed the integration of the latest Google Tag Manager (v5) for iOS together with Firebase (https://developers.google.com/tag-manager/ios/v5/).
The big change here is that the default container file is not binary anymore, it is plain JSON.

The integration requires that you have a folder (not group!) with the name "container" inside your app workspace. Within this folder the container file should be located. This raises my issue: We have two different GTM Containers, one for the testing/development app and one for production.

  • By using a folder it is not possible for me to add a different container file and set target references.

  • I can not create an additional folder since GTM requires the folder on root level and with the exact name "container"

Does anybody have an idea how this can be solved?


enter image description here

Answer Source

You should be able to configure an XCode "run script" build step that clears the container directory and copies the correct container into place.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download