Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-plugin-tealium

Usage

gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-tealium`,
      options: {
        account: "YOUR ACCOUNT ID",
        profile: "YOUR PROFILE ID",
        utagData: { key : "value" } // Optional object for initial UDO (utag_data) definition. If not provided, utag_data object is not created.
        env: "dev", // Either dev, qa, or prod
        injectUtagSync: true, // Toggles async loading for utag script
        disableInitialTracking: false, // Toggles tracking of initial pageload
      },
    },
  ],
};

Example

import { useTealiumViewEvent, useTealiumLinkEvent } from "gatsby-plugin-tealium"

const Page: GatsbyPage = () => {
  useTealiumViewEvent({
    key: "value",
  })

  const clickEvent = () => {
    useTealiumLinkEvent({
      key: "value",
    })
  }

  return (
    <>
      <h1>Hello, world.</h1>
      <button onClick={clickEvent}>Click here!</button>
    </>
  )
}
© 2023 Gatsby, Inc.