Error Handling

Troubleshooting the CMP behavior using the developer console of a browser is the best way to ensure that the tag implementation is done correctly. Some of the common issues that can impact CMP prompt are listed below.

HTTP 403

  • Site is attempting to load the CMP configuration and errors out
    GET https://cmp.inmobi.com/choice/tVZtC4A8fAP1L/www.inmobi.com/choice.js?tag_version=V3
    

    Solution: Please ensure that the API call, like the example above, matches the same site URL you configured in the InMobi CMP Portal. Most common mistakes include:

    Entering domain.com in the CMP 'Site' portal when the site loads as www.domain.com (or vice versa) - be sure these match exactly and are lower-case.

  • Not enabling 'Apply to all my subdomains?' option when creating or editing sites
     

    Solution: When you select Apply to all my subdomains, you must download the </> GET TAG instead of the Universal Tag, through the menu on the site entry in the site's table. For more details, see Sharing Consent Between Multiple Sites.

  • Not entering the exact 'accountId' or 'p-accountId'
     

    Solution: Copy it exactly since it is case-sensitive and does not include the 'p-' prefix.

  • Custom implementation invokes API to retrieve nonIAB vendor list
     

    Solution: Since the CMP handles the call to get non-IAB vendors by default, we do not recommend making edits to the tag to do so manually. If a developer intends to invoke this manually, they need to handle HTTP 403 error response returned when there are no non-IAB vendors listed for the account.

    GET https://cmp.inmobi.com/choice/tVZtC4A8fAP1L/www.domain.com/choice.js?tag_version=V3
    

Invalidly encoded Base64URL string 

  • Consent string format stored in other CMP not getting auto-picked and stored in InMobi CMP post migration
     

    Due to the non-standard storage behaviour of the other CMPs, the consent string is not getting auto-picked and an error "Invalidly encoded Base64URL string" is being thrown after migration to InMobi CMP.

    Some CMPs like liveramp store two objects under the variable “euconsent-v2“, namely data object and expiry object. The consent string is stored under the data object. When InMobi CMP tries to read the consent string, then it fetches the two objects instead of the consent string. Hence, it is failing to decode the value, giving the console error.

    Solution: Publishers can use the code below which reads the value from local storage and stores it in the cookie. Then InMobi CMP will start reading the cookie.

    
    <script>
    try {
      // Cookie max age, can be as per publisher
      const COOKIE_MAX_AGE = 13 * 30 * 24 * 60 * 60;
      // cookie name set by liveramp and used by Inmobi CMP
      const COOKIE_NAME = 'euconsent-v2';
      // Read euconsent-v2 string set by liveramp
      const euconsentv2 = JSON.parse(localStorage.getItem('euconsent-v2'));
      // Retrieve the TCF string
      const value = euconsentv2.data;
      // Store the tcf value in cookies
      const storeCookie = ()=> {
        const expires = new Date(Date.now() + COOKIE_MAX_AGE * 1000).toUTCString();
        const extraParams =
          window.location.protocol === 'https:' ? ';SameSite=Lax;secure' : '';
        const cookiePath = '/';
      
        document.cookie =
          COOKIE_NAME +
          '=' +
          value +
          ';path=' +
          cookiePath +
          ';max-age=' +
          COOKIE_MAX_AGE +
          ';expires=' +
          expires +
          ';domain=' +
          '/' +
          extraParams;
      };
      // Call the function
      storeCookie();
    
      // MAKE SURE TO REMOVE THE COOKIE FROM LOCAL STORAGE, AS INMOBI CMP ALSO READS FROM LOCAL STORAGE, 
      // AND WILL FAIL IF THIS IS NOT REMOVED.
      localStorage.removeItem(COOKIE_NAME);
    } catch(err) {
      console.warn('Error', err);
    }
    </script> 
    
    
     

    Note

    This code has the line “const value = euconsentv2.data;“, hence it assumes that the string is stored in the object data. This storage may differ for different CMPs - you should check how your previous CMP stores the consent and replace the above code accordingly.

    This is required until you migrate your entire traffic to InMobi CMP, and you can remove the code upon completion as it becomes unnecessary.

On This Page

Last Updated on: 22 Apr, 2025