How to use the analytics.event function in analytics

To help you get started, we’ve selected a few analytics 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 Kalcode / gatsby-boilerplate / src / reducers / forms / index.js View on Github external
static [Types.SUBMITTED](state, action) {
    let forms = { ...state }
    const { formId, data } = action
    const form = forms[formId]
    if (form) {
      form.fetching = false
      if (data.Success) {
        analytics.event('contact', 'submitted')
        form.submitted = true
        form.valid = true
        form.error = null
      } else {
        // Error has occured
        form.submitted = false
        form.valid = false
        form.error = {
          fields: data.FieldErrors,
          ErrorText: data.ErrorText,
        }
      }
    } else {
      console.error('Redux (forms): Unknown formId')
    }
    return { ...state, ...forms }
github dlopuch / venture-dealr / public / js / stores / scrollSpyStore.js View on Github external
doLogLastActivation = function() {
    // cleanup
    doLogLastActivation = null;
    clearTimeout(doLogLastActivationTimeout);

    // log the previous event
    var timeSpentMs = Date.now() - scenarioHitMs;
    analytics.event(analytics.E.SCROLL_SPY.ID, analytics.E.SCROLL_SPY.SCENARIO_DURATION, scenario, timeSpentMs);

    // queue up a watchdog
    doLogLastActivationTimeout = setTimeout(doLogLastActivation, 6 * 60 * 1000);
  };
}
github mozilla / thimble.mozilla.org / public / friendlycode / js / fc / ui / editor-toolbar.js View on Github external
mapNavItem.click(function() {
      var showMapping = !Preferences.get("showMapping");
      analytics.event( "Show Mapping", {
        label: showMapping ? "Enabled" : "Disabled"
      });
      Preferences.set("showMapping", showMapping);
      Preferences.save();
    });
github dlopuch / venture-dealr / public / js / views / scrollSpyContents / SeedValue.jsx View on Github external
switchToPercentage() {
    analytics.event(
      analytics.E.ROUND_CHART_BUTTON.ID,
      analytics.E.ROUND_CHART_BUTTON.PERCENTAGE_VIEW,
      SCROLLSPY_PROPS.id
    );
    actions.chart.selectMeasure('percentages');
  },
github dlopuch / venture-dealr / public / js / views / scrollSpyContents / LiquidationPreferencesExit.jsx View on Github external
.on('slideStop', function(slideEndValue) {
      analytics.event(
        analytics.E.SLIDER.ID,
        analytics.E.SLIDER.SLIDE_STOP,
        SCROLLSPY_PROPS.id,
        Date.now() - slideStartMs,
        {
          startValue: slideStartValue,
          endValue: slideEndValue
        }
      );
    });
  },
github dlopuch / venture-dealr / public / js / views / scrollSpyContents / UnderwaterOptionsExit.jsx View on Github external
.on('slideStop', function(slideEndValue) {
      analytics.event(
        analytics.E.SLIDER.ID,
        analytics.E.SLIDER.SLIDE_STOP,
        SCROLLSPY_PROPS.id,
        Date.now() - slideStartMs,
        {
          startValue: slideStartValue,
          endValue: slideEndValue
        }
      );
    });
  },
github mozilla / thimble.mozilla.org / public / friendlycode / js / fc / ui / history.js View on Github external
redo.click(function() {
      analytics.event("Redo");
      codeMirror.redo();
      refreshButtons();
    });
    codeMirror.on("change", refreshButtons);
github dlopuch / venture-dealr / public / js / views / scrollSpyContents / DownRound.jsx View on Github external
switchToPercentages() {
    analytics.event(
      analytics.E.ROUND_CHART_BUTTON.ID,
      analytics.E.ROUND_CHART_BUTTON.PERCENTAGE_VIEW,
      SCROLLSPY_PROPS.id
    );
    actions.chart.selectMeasure('percentages');
  },
github dlopuch / venture-dealr / public / js / views / scrollSpyContents / SeriesC.jsx View on Github external
switchToPercentage() {
    analytics.event(
      analytics.E.ROUND_CHART_BUTTON.ID,
      analytics.E.ROUND_CHART_BUTTON.PERCENTAGE_VIEW,
      SCROLLSPY_PROPS.id
    );
    actions.chart.selectMeasure('percentages');
  },