Error Messages in the Browser Console due to CORS Policy

Problem

In the browser console, error messages related to CORS policy were observed.

mceclip0.png

Cause

The API endpoint 'https://websdk.moengage.com/v2/device/add' belongs to the US cluster and the account to which the data was being redirected to exists in the EU cluster. As the Device Add calls were not being made to the correct API, CORS error is seen in the browser console.

Solution

In the script where the MoEngage SDK is being initialized, ensure the data is being redirected to the EU cluster by passing cluster"eu" key-value pair. Once this key-value is pair is added, clear the browser local storage and reload the page. The error messages would no longer be seen on the browser console. 

Was this article helpful?
0 out of 6 found this helpful

How can we improve this article?