Cookie Consent banner doesn't show up in React Native app

Hey,

I have a problem with displaying Cookie Consent banner in my React Native app. It doesn’t show up at all, even though to my understanding should work out of the box.

Things I have checked:
@piwikpro/react-native-piwik-pro-sdk package v1.1.0 installed and initialized successfully without errors
— “Ask visitors for consent” setting is turned on in the dashboard
— “Consent Form” selected in the Reminder-section of Consent settings

What should I do in order to get it to work?

Thanks

Hey @sergey.orangit,

Please make sure that “Use a custom consent form” is disabled -


Otherwise the default consent banner will be hidden.

You can find this option when you click on the “View” button

Please let me know if you still have the issue.

Have a great day! :slight_smile:

Hey Kamil,

I can confirm that “Use a custom consent form” setting is disabled. Here is a screenshot (in Finnish):

Is there any other setting I should check?

Best Regards,
Sergey

Hi @sergey.orangit,

Are there any errors in console that would indicate any issue with loading, either Piwik PRO or consent itself? (If the issue is with loading Piwik PRO itself, you will also not see any data collected, as currently you have turned on Anonymous tracking which should work regardless of consent)

Best,
Oliwer

Hey Oliwer,

There is no errors in the console, and the initialization goes through from what I can see.

Here is the initialization code:

  const piwikUrl = process.env.PIWIK_URL as string;
  const piwikKey = process.env.PIWIK_KEY as string;
  
  useEffect(() => {
    async function initPiwik() {
      try {
        await PiwikProSdk.init(piwikUrl, piwikKey);
        console.log("Piwik initialized successfully");
      } catch (error) {
        console.error("Error initializing Piwik", error);
      }
    }
    initPiwik()
  }, [piwikUrl, piwikKey]);

Both PIWIK_URL and PIWIK_KEY have values. I can see the “Piwik initialized successfully” -message in the console.

What else should I look into? Also, could you maybe elaborate on the Anonymous tracking — could it be the reason why the consent banner doesn’t show up?

Hi @sergey.orangit,

Could you please share with me a link to the page where I could test the solution?
In regards to anonymous tracking, it is something that if you have Consent Manager turned ON (which based on your settings I can see that it is turned on) every visitor should be automatically seen as anonymous (so when sending requests to Piwik PRO, those requests will have information that the IP address should be fully masked and geolocation data should not be deeper then country level (or not available at all depending on your geo location settings)) and only tags with “consent not required” consent type will fire. Only once someone changes their consent status to “agree” in consent form, they will no longer be anonymous.

Best,
Oliwer

Hi,

I have created an empty React Native app and added Piwik Pro. Still no cookie consent banner to be seen, even though the library has been initialized successfully.

Have a look yourself:

Cheers,
Sergey

Hi Sergey,

I didn’t notice that we are talking about mobile SDK. For Mobile SDKs the CMP does not work, it’s only for web applications. You are able to deanonimize and anonimize the requests send to Piwik PRO, but the consent form will not show up.

Best,
Oliwer