Created
July 2, 2019 15:16
-
-
Save samdozor/d59f0d11e59e93d8ff22f72e2bd0f8da to your computer and use it in GitHub Desktop.
Self Configuration Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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