Document Tree
    Document Properties
    Kbid
    30815Y
    Last Modified
    20-Mar-2024
    Added to KB
    18-Apr-2023
    Public Access
    Everyone
    Status
    Online
    Doc Type
    Guidelines
    Product
    Intershop Progressive Web App
    Guide - Intershop Progressive Web App - Google Tag Manager

    To enable user tracking and setting it up with Google Tag Manager, the popular library Angulartics2 is used.

    Note

    The standard Intershop PWA Google Tag Manager integration is very basic and currently only supports the tracking of route changes.

    Please refer to the angulartics2 documentation for information on how to enable tracking for additional events (e.g. e-commerce events).

    This feature only works in combination with Server Side Rendering, where the initial tracking configuration is set if the feature is enabled.

    Important

    The actual tracking on the client side will only work if the user has given his consent for tracking via the cookie banner or setting the according cookie preferences.

    To activate GTM tracking, set the Tag Manager Token either in the used Angular CLI environment file with the property gtmToken or via the environment variable GTM_TOKEN.
    Additionally, the feature toggle tracking has to be added to the enabled feature list.

    The configuration via system environment variables is recommended since it is more flexible for different deployments and it does not require to add tokens to the PWA source code.

    Example via environment.ts file:

    features: ['tracking'],
    gtmToken: 'GTM-ABCDEFG',

    Example via docker-compose.yml configuration:

    pwa:
      environment:
        - FEATURES=tracking
        - GTM_TOKEN=GTM-ABCDEFG

    Example via PWA Helm Chart:

    environment:
      - name: FEATURES
        value: tracking
      - name: GTM_TOKEN
        value: GTM-ABCDEFG

    Important

    For GDPR compliance the tracked IPs have to be anonymized, see How to turn on IP anonymization in Google Analytics and Google Tag Manager.

    Disclaimer
    The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
    The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties. Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
    Home
    Knowledge Base
    Product Releases
    Log on to continue
    This Knowledge Base document is reserved for registered customers.
    Log on with your Intershop Entra ID to continue.
    Write an email to supportadmin@intershop.de if you experience login issues,
    or if you want to register as customer.