Question

I just started working on Google Tag Manager. I got it worked. But I faced one issue. That is, each time I edit or add some new macros, I need to create new version and publish it. Unless I am not downloading the new version and saving inside assets/tagmanager and also unless I refer with the new version name of the downloaded file, I am not able to see my updates.

Is it so? If so, I didn't understand why this is useful. Is anything done by me went wrong?

Was it helpful?

Solution

I got it worked.The issue was when we keep the json or binary inside assets folder, then on openContainer() call, Google Tag Manager will check for the saved file first. Then only it will goto the network and search. This caused issue to me. So I removed the file kept inside assets/tagmanager folder.

Also I called container.refresh() before we set value inside the singleton class.

Sample code:

ContainerOpener.openContainer(tagManager, CONTAINER_ID, OpenType.PREFER_NON_DEFAULT,
    TIMEOUT_FOR_CONTAINER_OPEN_MILLISECONDS, new ContainerOpener.Notifier() {

        @Override
        public void containerAvailable(Container container) {
            container.refresh();
            // Save container for use by any other activities in the app.
            WPContainerHolder.setContainer(container);
            //perform your other functionalities
        }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top