Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shicheng/fence 2084 mparticle web doc #550

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion docs/integrations/mparticle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ If not leveraging a customer ID in mParticle but there is a need to set the Rada
defaultValue="swift"
values={[
{ label: 'Swift', value: 'swift' },
{ label: 'Kotlin', value: 'kotlin' }
{ label: 'Kotlin', value: 'kotlin' },
{ label: 'Web', value: 'web' }
]}
>
<TabItem value="swift">
Expand Down Expand Up @@ -90,6 +91,30 @@ MParticle.getInstance()?.Identity()?.addIdentityStateListener { user, _ ->
```

</TabItem>
<TabItem value="web">

Follow instructions from mParticle for web initialization, then add the mParticle ID to Radar metadata on initialization.

```js
window.mParticle = {
config: {
...
identityCallback: function(result) {
if (result.getUser()) {
Radar.setMetadata({"mParticleId": result.getUser().getMPID()})
} else {
// the IDSync call failed
}
}
}
};

(
function(e){window.mParticle=...}
)("REPLACE WITH MPARTICLE API KEY");
```
</TabItem>

</Tabs>

### Kit
Expand Down
Loading