GTM Data Layer: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

29 December 2024

  • curprev 16:2716:27, 29 December 2024Video8 talk contribs 1,394 bytes +157 No edit summary undo
  • curprev 16:2616:26, 29 December 2024Video8 talk contribs 1,237 bytes +1,237 Created page with "This JavaScript is added in the header of the website: <syntaxhighlight lang="javascript"> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } </syntaxhighlight> The `dataLayer` collection is sent to Google Tag Manager. The `gtag()` function is a convenience for sending this data. After the document content is loaded, it can be used to send event data to GTM. <syntaxhighlight lang="javascript"> gtag("event", "purchase", {..."