Gatsby Book Launch

“The missing guide to the modern web” launches on Thursday, Sep 29th: Modular: The Web’s New Architecture

ContactSign Up for Free
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>
    </>
  )
}
© 2022 Gatsby, Inc.