How to use amplitude - 4 common examples

To help you get started, we’ve selected a few amplitude 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 d14na / zeronet-explorer / src / constants / Shared.js View on Github external
const TrackEvent = function(_eventType) {
    /* DO NOT TRACK DEVELOPMENT */
    if (__DEV__ === true) {
        return console.log('NOT tracking this event in __DEV__');
    }

    /* Initialize Amplitude Id. */
    const amplitudeId = 'beadb78ade3fd20e320417ed123488b4';

    /* Initialize Amplitude. */
    const amplitude = new Amplitude(amplitudeId);

    /* Retrieve device id. */
    // const device_id = DeviceInfo.getUniqueID();
    // console.info('Device Unique Id', device_id);

    /* Set the tracking data. */
    const trackingData = {_eventType};
    // const trackingData = {_eventType, device_id}

    /* Call Amplitude api (DO NOT 'REPORT' THESE ERRORS). */
    // FIXME Filter the common error `Error: Unsuccessful HTTP response`
    amplitude.track(trackingData).catch(e => console.error(e));
};
github d14na / zeronet-explorer / src / frames / Main.js View on Github external
constructor(props) {
        super(props)

        console.log('Main Frame received props', props)

        this._addLog = this._addLog.bind(this)
        this._handleSearchInput = this._handleSearchInput.bind(this)
        this._handleSearchSubmit = this._handleSearchSubmit.bind(this)

        // const bugsnag = new Client()
        // bugsnag.notify(new Error("TEST: First error"))

        /* Initialize amplitude. */
        const amplitude = new Amplitude('beadb78ade3fd20e320417ed123488b4')

        /* Set the event type. */
        const event_type = 'MAIN_'

        /* Retrieve device id. */
        const device_id = DeviceInfo.getUniqueID()
        console.info('Device Unique Id', device_id)

        /* Set the tracking data. */
        const trackingData = { event_type, device_id }

        /* Call amplitude api. */
        amplitude.track(trackingData)

        /* Initialize the local state. */
        // this.state = {
github manojVivek / medium-unlimited / src / analytics.js View on Github external
function _createClient(user_id) {
  return new AmplitudeClient(amplitudeApiKey(), {user_id});
}
github rocketshipapps / adblockfast / opera / chrome / scripts / background.js View on Github external
localStorage.firstBuild = BUILD;
  localStorage.whitelist = JSON.stringify({});
  spawn(PATH + 'markup/firstrun.html');
}

if (!PREVIOUS_BUILD || PREVIOUS_BUILD < 5)
    localStorage.uids = JSON.stringify([]);

if (!PREVIOUS_BUILD || PREVIOUS_BUILD < 7) {
  WHITELIST['buy.buysellads.com'] = true;
  WHITELIST['gs.statcounter.com'] = true;
  localStorage.whitelist = JSON.stringify(WHITELIST);
}

if (IS_UPDATING_TO_CURRENT) {
  WHITELIST['amplitude.com'] = true;
  WHITELIST['analytics.amplitude.com'] = true;
  WHITELIST['sumo.com'] = true;
  WHITELIST['www.cnet.com'] = true;
  WHITELIST['www.stitcher.com'] = true;
  localStorage.whitelist = JSON.stringify(WHITELIST);
  localStorage.build = BUILD;
}

firebase.initializeApp({
  apiKey: 'AIzaSyAEyH0_n6vGCimJnyGjuGXXsfYwhAqzm8Q',
  appId: '1:109831748909:web:ce760a23eb8a204d7de7a4',
  authDomain: 'adblock-fast.firebaseapp.com',
  databaseURL: 'https://adblock-fast.firebaseio.com',
  messagingSenderId: '109831748909',
  projectId: 'adblock-fast',
  storageBucket: 'adblock-fast.appspot.com'

amplitude

A node wrapper for Amplitude analytics http api

ISC
Latest version published 3 years ago

Package Health Score

44 / 100
Full package analysis

Popular amplitude functions