Google Analytics 4

The Google Analytics app is a wrapper around the Google Analytics Data: Node.js Client. It provides a consistent interface for interacting with Google Analytics 4 API within the confines of our framework.

App Store

In order to save the clients auth tokens, this package extends app store.

It will automatically install the Google Analytics app into the app store database when you include it in your project.

Installation

To start using the Google Analytics app, follow these instructions:

  1. Install the package
pnpm install @juicyllama/app-google-analytics4
  1. Add the module to your application
// app.module.ts
import { GoogleAnalyticsModule } from '@juicyllama/app-google-analytics4'

@Module({
    imports: [GoogleAnalyticsModule.forRoot()],
})
export class AppModule {}

Note: this app supports experimental feature to configure a custom mount point: you can pass route prefix into GoogleAnalyticsModule.forRoot():

GoogleAnalyticsModule.forRoot('/my-apps/ga4')

This will mount application routes under the custom route instead of the default /apps/google-analytics

Environment Variables

Once your app is created in Google Cloud, you will be given the following credentials:

GA4_OAUTH_CLIENT_ID=
GA4_OAUTH_CLIENT_SECRET=

Modules

Each endpoint in the Shopify API is built with it's own module, this allows you to install just the module you need, we currently support:


Docs v.0.14.0 Copyright © 2024