Skip to content

Instantly share code, notes, and snippets.

@samdozor
Created July 2, 2019 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samdozor/d59f0d11e59e93d8ff22f72e2bd0f8da to your computer and use it in GitHub Desktop.
Save samdozor/d59f0d11e59e93d8ff22f72e2bd0f8da to your computer and use it in GitHub Desktop.
Self Configuration Example
import mParticle from '@mparticle/web-sdk';
import mParticleConfig from './mpconfig.prod.json';
import gaKit from '@mparticle/web-google-analytics-kit'
gaKit.register(mParticleConfig);
// this is required to instruct the SDK that the configuration
// does not need to be refreshed by the SDK on init.
mParticleConfig.requestConfig = false;
mParticle.init('REPLACE ME', mParticleConfig);
window.mParticle.ready(
function() {
window.performance.mark('mark_mparticle_fully_loaded');
mParticle.logEvent("Example event!");
console.log('mParticle self-hosted config has loaded!');
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment