AttriModel

GTM Variable Generator

Generate GTM variable configurations ready to copy into Google Tag Manager.

Variable Settings

Use dot notation to access nested keys.

Generated Configuration
Generated configuration will appear here

How to Use

Follow these simple steps to get started instantly — no signup required.

Choose a variable type

Data Layer, JavaScript, Constant, First-Party Cookie, or URL component.

Configure the details

Set the variable name, key or path, and any default values.

Review the configuration

The generator outputs the exact settings to enter in GTM.

Create it in GTM

Mirror the configuration in Google Tag Manager and use the variable in your tags.

Configure GTM variables right the first time

Google Tag Manager variables look simple, but small configuration choices — data layer version, default values, dot-notation paths — determine whether your tags receive clean data or "undefined". Debugging a mistyped data layer key in GTM Preview mode is a rite of passage nobody enjoys.

The GTM Variable Generator walks through each variable type's options and outputs a configuration you can mirror exactly in the GTM interface, with the naming conventions that keep large containers manageable.

Five variable types, one consistent workflow

Data Layer Variables read pushed event data. JavaScript Variables read page globals. Constants hold reusable IDs. First-Party Cookie variables read consent flags and user identifiers. URL variables extract components like path or query parameters for trigger conditions.

Knowing which type fits the job — and configuring it correctly — is most of GTM competence. The generator encodes those decisions so your whole team configures variables the same way.

Naming conventions that scale

A container with 40 variables named "variable 3 copy" is unmaintainable. The generator encourages prefixed names — dlv. for data layer, js. for JavaScript, const. for constants — so anyone opening your container can read its structure at a glance.

Frequently asked questions

Related tools