Does GoogleTagManager API exposes values as well?

51 Views Asked by At

TGM documentation shows we can get a list of all the variables, but not their values.

Is there a way to get all the values of each var?

https://developers.google.com/tag-platform/tag-manager/api/v2/reference#Variables

1

There are 1 best solutions below

13
BNazaruk On

You have to keep in mind that what you see in GTM is not code at runtime. GTM is just a way to configure logic. GTM itself has no clue what happens on pages. It also does not receive any data from the pages.

As such, its API has no idea what tags are triggered, what variables are used, or what values are stored there.

The API, however, allows you to get all the meta data about the variables. You can get their type, you can see where they're referenced, you can see what's hardcoded in them or what code they execute.

Why do you need to know the values of the variables to be available via the API? Looks like you're trying to solve a problem with an inappropriate tool.