问题
I have read through all the posts here and other and can not find out how to make this work.
I am following this from google: https://developers.google.com/tag-manager/android/v4/
In it is says to download a binary. However, I have no option at all on my container to download a binary file for the container. Only JSON.
I verified that the container is set to Android.
When I try to use the JSON file like the following:
TagManager tagManager = TagManager.getInstance(this);
PendingResult<ContainerHolder> pending =
tagManager.loadContainerPreferNonDefault(CONTAINER_ID,
R.raw.gtm_default_container_json);
It fails with:
java.lang.RuntimeException: JSONArrays are not supported
Any help with this would be appreciated!!
Thanks!
回答1:
On the draft version or a web container, Download
is not enabled, so the menu looks like this:
(Export
is not the correct method, it creates a JSON file that is primarily used to copy configurations within the tag manager GUI.)
For a Published (or really any non-draft) Mobile container, you will have the option to Download
:
The container version you download and embed will be applied by new downloads of your application and determine what the tracking they generate looks like until they are able to download your latest published version.
回答2:
If approved solution doesn't work for you, maybe it's because you are implementing the legacy version of Google Tag Manager but configured the container as a Firebase instead of Legacy.
Create a new Legacy(Android) container and then you can download the binary file.
来源:https://stackoverflow.com/questions/34098881/google-tag-manager-v4-binary-download-container