gatsby-plugin-tealium-utag

1.1.0 • Public • Published

gatsby-plugin-tealium-utag

This plugin inserts Tealium's utag to the <body> of Gatsby pages.

Install

npm install --save gatsby-plugin-tealium-utag

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-plugin-tealium-utag",
      options: {
        account: "YOUR_TEALIUM_ACCOUNT",
        profile: "YOUR_TEALIUM_PROFILE",
        env: "dev",
        injectUtagSync: true,
        disableInitialTracking: true
      }
    }
  ]
};

Required Options

account

Your Tealium account name.

profile

Your Tealium profile name.

env

Must be "dev", "qa", or "prod".

Optional Options

injectUtagSync

Defaults to false.

When set to true, utag.sync.js will be injected to the <head>.

disableInitialTracking

Defaults to false.

When set to true, utag.view() won't be called automatically on page load. Usually, that's what you want in Single Page Applications.

Notes

  • This plugin just adds the utag script to the page. It's up to you to call utag.view() and utag.link() in your app.
  • utag.js loads asynchronously. To know when it finished loading, listen to the "utag-loaded" event on the document:
document.addEventListener("utag-loaded", () => {
  console.log("utag is ready:", utag);
});

Package Sidebar

Install

npm i gatsby-plugin-tealium-utag

Weekly Downloads

189

Version

1.1.0

License

MIT

Unpacked Size

5.01 kB

Total Files

5

Last publish

Collaborators

  • moroshko
  • praneybehl
  • zecuria
  • alifa20
  • strahinjaajvaz