Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

@scullyio/scully-plugin-google-analytics

Package Overview
Dependencies
18
Maintainers
4
Versions
169
Issues
File Explorer

Advanced tools

@scullyio/scully-plugin-google-analytics

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

    2.1.32latest

Version published
Maintainers
4
Yearly downloads
10,142
increased by502.26%

Weekly downloads

Readme

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

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc