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

@scullyio/scully-plugin-google-analytics

Package Overview
Dependencies
Maintainers
4
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scullyio/scully-plugin-google-analytics

- Description: This plugin allows the usage of Google Analytics via Global Site Tag. - Type: Render Plugin

  • 2.1.21
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
4
Weekly downloads
 
Created
Source

plugins-google-analytics

  • Description: This plugin allows the usage of Google Analytics via Global Site Tag.
  • Type: Render Plugin

Getting Started

1. Install the plugin:

npm install -D @scullyio/scully-plugin-google-analytics

2. Use the plugin:

In the application's scully..config.ts:

  1. Configure the plugin:

The plugin's configuration receives an object like this {globalSiteTag: string} where the globalSiteTag is the gtag provided by Google Analytics.

  1. Make a default post render array and add the plugin to it.

  2. Set the default post renders in Scully config.

e.g. ./scully.<your-app>.config.ts

import { setPluginConfig, ScullyConfig, prod } from '@scullyio/scully';
import { GoogleAnalytics } from '@scullyio/scully-plugin-google-analytics';

const defaultPostRenderers = [];

if (prod) {
  setPluginConfig(GoogleAnalytics, { globalSiteTag: 'UA-#########-1' });
  defaultPostRenderers.push(GoogleAnalytics);
}
export const config: ScullyConfig = {
  defaultPostRenderers,
  routes: {
    '/': {
      type: 'contentFolder',
      postRenderers: [...defaultPostRenderers],
    },
  },
};

Running unit tests

Run ng test plugins-google-analytics to execute the unit tests via Jest.

Keywords

FAQs

Package last updated on 02 Mar 2022

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