Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

dataLayer Push Generator — Google Tag Manager Events

Build dataLayer.push() code for Google Tag Manager: choose a GA4 recommended event or your own, add parameters and ecommerce items, and optionally wrap it in a click or form submit listener — ready to paste.

Atualizado em

Items

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como usar: dataLayer Push Generator

  1. Choose an event or type your own event name.
  2. Add parameters and, for ecommerce, items.
  3. Copy the dataLayer.push() code into your page.
  4. In Tag Manager, add a Custom Event trigger with the same name and a GA4 event tag that reads the values through Data Layer Variables.

Wiring it up in Tag Manager

Each push needs an event key — that is what a Custom Event trigger listens for. Read the other keys with Data Layer Variables (for example form_name) and pass them as event parameters in the GA4 tag. For ecommerce, check “Send ecommerce data” in the GA4 tag and it reads ecommerce.items for you. Install the container with the GTM Snippet Generator.

Também pesquisado como: datalayer push code, gtm datalayer event, gtm custom event, datalayer ecommerce, datalayer push example, gtm event code.

Ferramentas que combinam com: dataLayer Push Generator

  • GA4 Event Code Generator — Pick a recommended GA4 event — generate_lead, sign_up, purchase, add_to_cart and more — or name your own, fill in the parameters and items, and copy the code as gtag(), a Tag Manager dataLayer.push() or a server-side Measurement Protocol request.
  • Event Tracking Script Generator — Track button clicks, links and form submits by adding attributes instead of code: data-track="sign_up_click" plus optional data-track-* parameters.
  • GA4 Request Decoder — Debug Google Analytics 4 without guesswork.
  • Tracking & Pixel Checker — Enter a URL to find every analytics tag, ad pixel and tag manager on the page — with their IDs, what’s loaded inside Google Tag Manager, the cookie consent tool, and Search Console / Bing verification tags.

Perguntas frequentes

Why push ecommerce: null first?
The dataLayer merges objects, so items from an earlier push can carry into the next event. Clearing ecommerce first is what Google recommends.
Does the dataLayer need to exist before GTM loads?
The generated code starts with window.dataLayer = window.dataLayer || [], so it works before or after the container loads.
How do I read a value from the push in a tag?
Create a Data Layer Variable in Tag Manager with the key name, such as form_name, and use it in the tag as {{DLV - form_name}}.
Posso instalar o dataLayer Push Generator como um aplicativo da web e usá-lo offline?
Sim. O dataLayer Push Generator é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas