I am trying to implement a fairly new Android TagManager from Google. I can't seem to load the defaults.
I created my default json file:
assets/tagmanager/GTM-xxx.json
Which looks like this:
{ 'eulaTextVersion': '1' }
I also added this code to actually pull out the default file if nothing was found on the server:
TagManager mTagManager = TagManager.getInstance(this); // The container is returned to containerFuture when available. ContainerOpener.openContainer( mTagManager, // TagManager instance. CONTAINER_ID, // Tag Manager Container ID. OpenType.PREFER_NON_DEFAULT, // Prefer not to get the default container, but stale is OK. null, // Time to wait for saved container to load (ms). Default is 2000ms. new ContainerOpener.Notifier() { // Called when container loads. @Override public void containerAvailable(Container container) { // Handle assignment in callback to avoid blocking main thread. mContainer = container; } } ); int eulaTextVersion = (int) mContainer.getDouble("eulaTextVersion");
However, when I debug, my int eulaTextVersion always zero, I can never get it at 1, as if it should be from my json by default. Can someone please help me and show me where I am going wrong?
Thanks for the help.
json android google-tag-manager
AlexIIP
source share