donni106 / matomo-tracker-react-native

Stand alone library for using Matomo tracking in React Native and Expo projects.
MIT License
47 stars 15 forks source link

Page URL not defined #27

Open othmenbahriyo opened 1 month ago

othmenbahriyo commented 1 month ago

I already have the 'Page URL not defined' message in Matomo.

Screenshot 2024-09-24 at 10 15 18
donni106 commented 1 month ago

Hi @othmenbahriyo can you please elaborate a bit? What app are you building and what page urls are you expecting in Matomo? Do you have specifig screens that should map to page urls to be visible in tracking?

othmenbahriyo commented 1 month ago

Hi @donni106, i want to display the URL of pages in Matomo like in the first image, but I'm getting the result shown in the second image i use this code :

 if (status === 'granted' || status === 'undetermined') {
      await trackScreenView({
        name: screenName,
        userInfo: {
          rec: 1,
          action_name: screenName,
          urlref: "/" + screenName,
          url:  "/" + screenName,
          lang: Localization.locale,
          res: ${SCREEN_WIDTH}x${SCREEN_HEIGHT},
          ua: deviceName,
          new_visit: 0,
          uid: user,
          dimension1: 'V2',
          dimension2: Localization.locale,
          dimension3: authenticated['authenticated'] === true ? 'connected' : 'not connected',
          dimension4: statusLocation,
          apiv: 1,
        },
      });
    }

log: https://matomo.tooling.myoddcloud.com/matomo.php/matomo.php {"body": "idsite=9&rec=1&apiv=1&send_image=0&e_c=navigation&e_a=click_button&e_n=itinerary&e_v=undefined&mtm_campaign=&res=393x852&ua=iPhone+15&new_visit=0&uid=00odch80nhpUIz3JK417&dimension1=V2&dimension2=en-GB&dimension3=connected&dimension4=granted", "headers": {"Accept": "application/json", "Accept-Language": "en-GB", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}, "method": "POST"}

Screenshot 2024-09-24 at 12 44 38 Screenshot 2024-09-24 at 12 47 29