🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@simpozio/gatsby-plugin-analytics

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@simpozio/gatsby-plugin-analytics

Plugin for handling event tracking with Google Analytics and Facebook Pixel.

0.0.1
Source
npm
Version published
Maintainers
2
Created
Source

Gatsby Plugin for Analytics

Gatsby plugin that combined logic of Google Analytics and Facebook Pixel in single plugin.

Installation

npm i @simpozio/gatsby-plugin-analytics

Usage

Install plugin package from npm and add plugin configuration to your gatsby-config.js file

/* gatsby-config.js */
module.exports = {
  plugins: [
    {
      resolve: '@simpozio/gatsby-plugin-analytics',
      options: {
        head: true,
        fbq: {
          pixelId: 'your Facebook pixel id',
          disablePushState: true,
          trackViewContent: false,
          trackPageView: false
        },
        gtag: {
          trackingIds: ['your Google Analytics id', 'your Google Ads id', 'your Marketing Platform id'],
          trackPageView: false,
        }
      }
    }
  ]
}

Options

  • head: boolean - if true include script tags into head, else add them to the body
  • fbq: object - configuration for Facebook Pixel, includes next properties:
    • pixelId: number - your Facebook Pixel ID
    • disablePushState: boolean - enable/disable PageView tracking on History updates
    • trackViewContent: boolean - enable/disable tracking of ViewContent event on every route update
    • trackPageView: boolean - enable/disable default PageView tracking
  • gtag: object - configuration for Google gtag.js, includes next properties:
    • trackingIds: string[] - array of tracking ID's of Google Services fits pattern - ['your Google Analytics id', 'your Google Ads id', 'your Marketing Platform id']
    • trackPageView: boolean - enable/disable default PageView tracking

Development

See simpozio-frontend-common library

Keywords

gatsby

FAQs

Package last updated on 01 Nov 2019

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