How to use the mixpanel-browser.set_config function in mixpanel-browser

To help you get started, we’ve selected a few mixpanel-browser 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 studentinsights / studentinsights / app / assets / javascripts / helpers / MixpanelUtils.js View on Github external
registerUser(currentEducator) {
    try {
      if (!isEnabled()) return;
      mixpanel.init(readEnv().mixpanelToken);
      mixpanel.set_config({
        track_pageview: true,
        secure_cookie: true,
        cross_subdomain_cookie: false // https://help.mixpanel.com/hc/en-us/articles/115004507486-Track-Across-Hosted-Subdomains
      });
      mixpanel.identify(currentEducator.id);
      mixpanel.register({
        'deployment_key': readEnv().deploymentKey,
        'district_key': readEnv().districtKey,
        'educator_id': currentEducator.id,
        'educator_is_admin': currentEducator.admin,
        'educator_school_id': currentEducator.school_id
      });
    }
    catch (err) {
      console.error(err); // eslint-disable-line no-console
    }