Calling document.cookie causes an error

android

#1

Would it be possible to allow it so that calling document.cookie does not throw an error? Perhaps maybe an empty string or null? It’s being called in our third-party script and its becoming difficult to load our scripts because this error will break the rest of our initialization.

We’ve also only noticed this on Android and not on iOS.


#2

Hey jn_work,

Can you provide the context, provide the exact error, and where the error occurred?

Can you also explain how you are using a third party script in your integration, so we understand what is happening?

Thanks!


#3

Hello ekinbenho,

Hope this explanation helps, please let me know if you need further clarification on anything.

Error:

Our creative units utilize a third-party tracking service (https://segment.com/docs/libraries/analytics.js/). This script will make a call to document.cookie to store data, but when making that call on MoPub’s Android SDK will throw an error which breaks the script and prevents us from utilizing the script to track our other events.


#4

Hello jn_work,

Can you check your content setting to make sure "Allow local data to be set (recommended) is set?

This is per the stackoverflow question here.

Let us know if this fixes your issue. If not, we can further troubleshoot.

Thanks!