tagmanager-wrap

4.0.1 • Public • Published

TagManager Wrap

Build Status Maintainability Test Coverage

Wrapping Google TagManager and adding some helpers to it.

Until v3.2.1

  • This script appends automatically the googleTagManager script.
  • It also adds an iframe inside a noscript tag for non-js fallback

After v3.2.1

  • This script don't append the GTM script automatically anymore. For this new version, you must implement GTM snippet following the official instructions.
  • Also, the noscript tag fallback isn't added anymore, because this tag is a fallback for disabled js on browsers, so there's no reason to add it through JS, because it won't work. To add this feature properly, follow the official instructions.

Documentation

See live here https://getninjas.github.io/tagmanager-wrap

Install

npm i tagmanager-wrap --save

yarn add tagmanager-wrap

Demo

npm run demo

yarn demo

Usage

You can use it via:

  • GLOBAL variabel
  • CommonJs
  • AMD
  • ES6 Module

Methods

  • prependExperiment(experiment)
  • eventCategory(event, infos)
  • custom(obj)
  • bindEvents() - gets all elements from the page that contains [data-gtm-event="ga-event"] and adds a click event

Readme

Keywords

Package Sidebar

Install

npm i tagmanager-wrap

Weekly Downloads

42

Version

4.0.1

License

MIT

Unpacked Size

31.2 kB

Total Files

19

Last publish

Collaborators

  • eduardojmatos
  • evemontalvao
  • getninjas-tech
  • iondrimba
  • pyymenta
  • wilfernandesjr
  • williamcosta
  • yvessacurae