Fahim Fahim - 1 month ago 28
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?

Thanks,
Fahim

enter image description here

Answer

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

Comments