Learn business growth with Google Analytics 4 Forums Google Analytics 4 Understanding the practical application of the 'Live' environment in Google Tag Manager

  • Understanding the practical application of the 'Live' environment in Google Tag Manager

    Posted by Sebastian on 21 June 2022 at 7:38 pm

    Just happened to go over this article on Google Tag Manager and environments, and it had this thing to say:

    Fun fact: Every GTM container automatically comes with a “Live” environment setting, which keeps track of the current container version that’s up and running. But there’s no need to define this Live environment yourself – it’s all good.

    However, it’s a tad ambiguous on where the GTM snippet that’s exclusive to the Live environment fits in. You can find it going through: “Admin” > “Environments” > “Live” > “Actions” > “Get Snippet”.

    On one hand, if you place this “Live” environment’s GTM snippet on your main site, gtm_auth & env parameter values are paraded around for everyone to see. On the other hand, we’ve been using the ‘default’ GTM snippet (accessible via “Admin” > “Install Google Tag Manager”) for our live site, and it’s been smooth sailing so far.

    So, why would someone go for the “Live” GTM snippet? Any thoughts?

    Kendall replied 1 year ago 3 Members · 2 Replies
  • 2 Replies
  • Daniel

    Member
    7 July 2022 at 1:34 am

    There really isn’t any particular advantage to using the “Live” GTM snippet. When you access this, you would get the environment parameters filled in just like for any other environment.

    Meanwhile, if you select “Install GTM”, the environment-specific parameters are omitted. This is because when these parameters aren’t specified, GTM will default to the live environment.

    Identifying the live environment via the snippet doesn’t provide any unique benefits, mainly because it’s not possible to alter which environment is seen as live. As per my knowledge, env-2 is always deemed live. It’s interesting because you might think that env-1 would be preserved for the primary live environment, but this isn’t the case.

  • Kendall

    Member
    1 May 2023 at 8:25 pm

    The “Live” Google Tag Manager (GTM) snippet is generally used to manage different environments on a website during development stages, such as testing tags on a staging site before pushing them live. This enables one to control what set of tags fire on each environment. For many, using the ‘default’ GTM snippet for their live site suffices since it automatically tracks the current container version that’s running. However, if one needs to manage multiple development stages or have additional control over when certain tags are fired, then the “Live” environment and its specific GTM snippet would be useful.

Log in to reply.