How to use the @shopgate/tracking-core/plugins/trackers/GaBase.default.createUniversal function in @shopgate/tracking-core

To help you get started, we’ve selected a few @shopgate/tracking-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shopgate / pwa / libraries / tracking / subscriptions / setup.js View on Github external
type: get(clientInformationResponse, 'value.device.type', TYPE_PHONE),
      os: get(clientInformationResponse, 'value.device.os.platform', OS_ALL),
      state: getState(),
      services: get(clientInformationResponse, 'value.device.supportedAnalyticsServices', []),
      libVersion: get(clientInformationResponse, 'value.libVersion'),
      appVersion: get(clientInformationResponse, 'value.appVersion'),
    };

    // TODO: instantiate the UnifiedPlugin only if a native tracker is configured (FB, AppsFlyer)
    // eslint-disable-next-line no-new
    new UnifiedPlugin();

    if (appConfig.tracking.hasWebTrackingEngage) {
      // eslint-disable-next-line global-require
      const GaBase = require('@shopgate/tracking-core/plugins/trackers/GaBase').default;
      GaBase.createUniversal({
        shopNumber,
        codebaseVersion: get(clientInformationResponse, 'value.codebaseVersion'),
        config: {
          merchant: [],
          shopgate: {
            id: clientInformation.os === OS_ANDROID ?
              appConfig.webTrackingEngage.android :
              appConfig.webTrackingEngage.ios,
            useNetPrices: false,
          },
        },
      });
    }

    try {
      // eslint-disable-next-line global-require, import/no-dynamic-require