Developers

Client SDK: Direct Url Routing

Web

This document explains the changes you may need to make to support the October 1st, 2024, update regarding Direct URL Routing.

Updates on your end are only required if you currently whitelist subdomains for mparticle.com as part of your Content Security Policy.

Please consult your web development and security teams to determine if this update effects you, and review our Content Security Policy docs. If you self-host mParticle, you must use SDK version 2.27.0 or later to take advantage of this feature. If you are on an earlier version, this feature does not impact you, and no action is needed at this time. However, once you update to 2.27.0 or later, you must ensure the actions below.

Any customers using version 2.27.0 or later should follow the instructions for each scenario below.

My company DOES use a CNAME to route data to mParticle

No further action is required. If you use a CNAME, you should not need to whitelist any mParticle domains.

My company DOES NOT use a CNAME to route data to mParticle, and we DO NOT whitelist subdomains using Content Security Policies

No further action is required. If you do not whitelist subdomains via CSP, there is no risk for data being interrupted.

My company DOES NOT use a CNAME, and we DO whitelist subdomains using Content Security Policies

  1. Add *.mparticle.com to your CSP whitelist. Using the * wildcard will accommodate future changes or additions to our SDK.
  2. Once the above has been added to your CSP whitelist, you can test your changes by following the below codeblocks to mimic the upcoming behavior:
// note that "[pod]" should be replaced with the geographic pod that you send data to
window.mParticle.config.v1SecureServiceUrl = 'jssdks.[pod].mparticle.com/v1/JS/';
window.mParticle.config.v3SecureServiceUrl = 'jssdks.[pod].mparticle.com/v3/JS/'
window.mParticle.config.identityUrl = 'identity.[pod].mparticle.com/v1/';
window.mParticle.config.aliasUrl = 'jssdks.[pod].mparticle.com/v1/identity/'

Was this page helpful?