I was learning Google Tag Manager. I have started with very basic tutorials, it is working nice. But one thing I dont get is the use of container json in android side. Suppose we have created the firebase analytics in android and added GTM and published the app. In GTM we have added some tags. Now later we want to send analytics to some other site or wish to add new tags, do we need to update container json file in android again and republish it.
问题:
回答1:
The JSON container file you're talking about is called Default Container File.
The function of this file is as follows:
Sometimes, when people open your app for the first time, they will not have a network connection or they will have a poor network connection. In this case, the GTM SDK will not be able to load the latest container from the GTM server over the internet. Instead, your app will load the Default Container File from the hard drive of the mobile device. As soon as a network connection is established, the GTM SDK will then load a potentially newer/more up-to-date container from the network.
So to answer your question, you don't need to update the Default Container File every time you make a change to your container (e.g. add or remove tags or change variables). Best practice is to only update the Default Container File when you're shipping a new version of your app to the relevant app store.
回答2:
No, you don't need to update your app. That's the purpose of tag manager:
"Developers can use the Google Tag Manager interface to implement and manage measurement tags and pixels in their mobile applications, without having to rebuild and resubmit application binaries to app marketplaces. Developers who are working with Firebase Analytics can easily add Google Tag Manager to help manage and make changes to the implementation, even after the app has shipped."
source: https://developers.google.com/tag-manager/ios/v5/