Is the Google Tag Manager container automatically refreshed? If so, how/where?
Asked Answered
E

1

6

I'm not clear on if the Google Tag Manager Container is automatically refreshed, and if so how.

The documentation states:

By default, your container becomes eligible to be refreshed every 12 hours. To manually refresh the container, use ContainerHolder.refresh():

ContainerHolderSingleton.getContainerHolder().refresh();

This is an asynchronous call that will not return immediately. To reduce network traffic, refresh() may only be called once every 15 minutes, otherwise it will be a no-op.

It's the "becomes eligible to be refreshed every 12 hours" paired with the "To manually refresh" part that is tripping me up. As such I have two questions:

  1. Does Google Tag Manager attempt to refresh the Container every 12 hours?
  2. If the answer to #1 is yes then where/how does this occur?

My assumption at this point is that the answer to #1 is "Yes".

My concern is that I'm not sure where this automatic refresh occurs and I only access the getContainer() in the ContainerAvailableListener and then cache the values. So if it's the getContainer() call that triggers the update, like happens with the "swapping" of a new container, my implementation might not be refreshing.

Edit: My reason for asking is that the lifetime of my application can be quite long. I'm trying to determine if I need to manage container refreshes in my code or not.

Exuviae answered 19/1, 2016 at 19:31 Comment(0)
H
0

I had a similar experience. When I updated the tags in Tag Manager, I didn’t see any results in Google Analytics. But the problem was that people simply open the service in a browser tab and they can have it open for several days without reloading the page. In yours (as in my case), you just need to wait until all users update/reload/restart the application or site. Because in order to implement a forced update of the container, you still need to deliver the source code to users that would do it. And here we return to the beginning of the problem.

Hymenium answered 22/5 at 17:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.