segmentio / analytics_flutter

The hassle-free way to add Segment analytics to your Flutter app.
MIT License
26 stars 33 forks source link

Events Not Appearing in Segment Dashboard Debugger Tab #69

Closed Samin-roadsurfer closed 2 months ago

Samin-roadsurfer commented 2 months ago

Environment

SDK/Library Version: segment_analytics: ^1.0.1 Platform: Flutter

Configuration

I am using the pub.dev version of the SDK, with our host located in EU west (events.eu1.segmentapis.com). Here is how the client is configured:

_segment = createClient(
  Configuration(
    writeKey, 
    trackApplicationLifecycleEvents: true,
    debug: true,
    apiHost: 'events.eu1.segmentapis.com',
  ),
);

Expected Behavior:

I expect to see logs on our Segment dashboard debug tab for this source when events are tracked.

Actual Behavior:

No logs appear on our Segment dashboard debug tab for this source. However, local console logs indicate that events are being tracked and saved successfully. Here are examples of the logs:


🐛 Segment: Received settings from Segment successfully.

🐛 Segment: TRACK event (Application Installed) saved:
│ 🐛 {"anonymousId":"5ab9dd3f-0bb4-4940-abb1-1deb5996dc61","messageId":"65c44a71-ca53-4f5d-a5d6-1dc67dbd975c","userId":null,"timestamp":"2024-04-05T09:37:56.059464", ...}

🐛 Segment: TRACK event (Application Opened) saved:
│ 🐛 {"anonymousId":"5ab9dd3f-0bb4-4940-abb1-1deb5996dc61","messageId":"c42b400c-306b-470e-87ed-e8dc1d350d8d","userId":null,"timestamp":"2024-04-05T09:37:56.114901", ...}

Steps to Reproduce:

Configure the Segment client as shown above. Run the application on an Android/IOS device. Observe the local console logs indicating that tracking events are saved. Check the Segment dashboard debug tab for the source and find no logs corresponding to these events.

Additional Context:

The write key has been double-checked for accuracy. The API host has been set correctly to our EU west host (events.eu1.segmentapis.com). I have followed the documentation closely and ensured that my configuration matches the recommended setup.

Could there be an issue with the events reaching the Segment backend, or is this a potential bug with the SDK?

edsonjab commented 2 months ago

Hi @Samin-roadsurfer could you help us check if logs sent another message? Did you try it run the web if it happens the same? Sometimes the devices don't have permissions to make API request. You can check our example here.

Samin-roadsurfer commented 2 months ago

Hey @edsonjab ,

Thanks for checking, i found out the default api-host of the package is for US and our source is EU. that is why i did not received any events . then i changed the api-host to EU one and i got this error:

image

i have no idea why, but i already contacted the support team for help. i'll update here when i have more info.

Samin-roadsurfer commented 2 months ago

I confirm that issue fixed with version 1.0.2 also you do not need to define the api-host if you are in EU-host.