How to use the amplitude function in amplitude

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});
}

amplitude

A node wrapper for Amplitude analytics http api

ISC
Latest version published 2 years ago

Package Health Score

44 / 100
Full package analysis

Popular amplitude functions