Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@frontity/google-tag-manager-analytics

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frontity/google-tag-manager-analytics

Analytics package to use Google Tag Manager with Frontity

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-64.42%
Maintainers
5
Weekly downloads
 
Created
Source

@frontity/google-tag-manager-analytics

Version npm License: Apache--2.0

Analytics package to use Google Tag Manager with Frontity

Install

npm i @frontity/google-tag-manager-analytics

Settings

The namespace for this package is googleTagManagerAnalytics

Every Google Tag Manager account has a Container ID. To connect the package with a specific account (or accounts) we can set the following properties in the frontity.settings.js:

  • state.googleTagManagerAnalytics.containerId: to specify just one container ID
  • state.googleTagManagerAnalytics.containerIds: to specify a list of container ID's
export default {
  packages: [
    {
      name: "@frontity/google-tag-manager-analytics",
      state: {
        googleTagManagerAnalytics: {
          containerId: "GTM-BCDFGHJ",
        },
      },
    },
  ],
};
export default {
  packages: [
    {
      name: "@frontity/google-tag-manager-analytics",
      state: {
        googleTagManagerAnalytics: {
          containerIds: ["GTM-BCDFGHJ", "GTM-HJSFDUF"],
        },
      },
    },
  ],
};

Usage

This @frontity/google-tag-manager-analytics package can co-exist with some other analytics packages. Once we have properly installed and configured these analytics packages, their actions will be centralized by the analytics namespace

  • actions.analytics.pageview() will take into account settings in state.analytics.pageviews
  • actions.analytics.event() will take into account settings in state.analytics.events

Read More info about how to use Analytic packages in the docs

actions.analytics.pageview

If @frontity/google-tag-manager-analytics is configured configured and enabled for pageviews in state.analytics.pageviews, every time a link changes (or every time action.router.set(link) is launched) a tracking for that page will be sent to Google Tag Manager.

actions.analytics.event

If @frontity/google-tag-manager-analytics is configured and enabled for events in state.analytics.events, every time you call the method actions.analytics.event() from any of your React components, the proper tracking info will be sent to Google Tag Manager.

The actions.analytics.event() must receive an event object with the following properties.

NameTypeDefaultRequiredDescription
namestring-trueThe value of this property is mapped to the event field of the object sent to GTM
payloadObject-trueEvent payload.

You can add any info you want in the payload object.

These values will be transfomed (by this package) into the proper format before sending the data to Google Tag Manager


Feature Discussions

Feature Discussions about Frontity are public. You can join the discussions, vote for those you're interested in or create new ones.

These are the ones related to this package: https://community.frontity.org/tags/c/feature-discussions/33/google-tag-manager

Changelog

Have a look at the latest updates of this package in the CHANGELOG


» Open Source Community

Community Forum Topics Twitter: frontity Frontity Github Stars

Frontity has a number of different channels at your disposal where you can find out more information about the project, join in discussions about it, and also get involved:

  • 📖 Docs: our primary documentation resource - this is the place to learn how to build amazing sites with Frontity.
  • 👨‍👩‍👧‍👦 Community forum: join Frontity's forum and ask questions, share your knowledge, give feedback and meet other cool Frontity people. We'd also love to know about what you're building with Frontity, so please do swing by the forum and tell us about your projects.
  • 🐞 Contribute: Frontity uses GitHub for bugs and pull requests. See our Contributing section to find out how you can help develop Frontity, or improve this documentation.
  • 🗣 Social media: interact with other Frontity users. Reach out to the Frontity team on Twitter. Mention us in your tweets about Frontity and what you're building by using @frontity.
  • 💌 Newsletter: do you want to receive the latest news about Frontity and find out as soon as there's an update to the framework? Subscribe to our newsletter.

» Get involved 🤗

GitHub issues by-label

Got questions or feedback about Frontity? We'd love to hear from you in our community forum.

Frontity also welcomes contributions. There are many ways to support the project! If you don't know where to start then this guide might help: How to contribute?.

If you would like to start contributing to the code please open a pull request to address one of our good first issues.

Keywords

FAQs

Package last updated on 26 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc