mParticle handles Web data — collected from a browser client — a little differently from data collected from native apps.
In most cases, data collected by the mParticle SDK is sent to mParticle, and then forwarded on to integration partners server-to-server.
There are exceptions to this rule: in cases where a server-to-server integration cannot support all the required functionality of an integration partner, an Embedded Kit may be used. Embedded Kits are extra components added to the mParticle SDK that communicate directly with an integration partner from the app client.
While direct communication between the client and partner is the exception for native apps, it is common for web data. A key reason for this is that most of mParticle’s integration partners are not set up to receive web data server-to-server, as they rely on cookie data only accessible to the cookie owner. To support these integrations, the mParticle Web SDK uses the following workflow:
analytics.js
snippet and mParticle’s GoogleAnalyticsEventForwarder.js
snippet. We fetch only the integrations that you have enabled in order to keep the page size to a minimum.pageview
method.// Example from GoogleAnalyticsEventForwarder.js
// When mParticle logs a Page View, it automatically calls this function, which invokes Google's `analytics.js` snippet to send the page view to Google Analytics
function logPageView() {
if (forwarderSettings.classicMode == 'True') {
_gaq.push(['_trackPageview']);
}
else {
ga(createCmd('send'), 'pageview');
}
}
To make it easier to work with web integrations, we provide the source code in a public repository, so you can work with the Integration Partner’s documentation and see exactly how we map mParticle methods onto the Partner code. See the mparticle-integrations organization for a complete list of client-side web integrations.
Was this page helpful?