adjust / flutter_sdk

This is the Flutter SDK of
MIT License
56 stars 47 forks source link

Event request failed (Invalid event token) #126

Open SrivastavaShubham99 opened 4 months ago

SrivastavaShubham99 commented 4 months ago

I am getting while tracking events in Adjust. Here is my bare minimum setup : AdjustConfig adjustConfig = AdjustConfig(appToken, AdjustEnvironment.sandbox); adjustConfig.logLevel = AdjustLogLevel.verbose; Adjust.setEnabled(true);

and here it is how I am using : AdjustService.trackEvent("abc123");

This is the error I am getting : Response string: {"timestamp":"2024-02-12T12:30:47.401Z+0000","message":"Event request failed (Invalid event token)","error":"Event request failed (Invalid event token)"}

uerceg commented 4 months ago

Hey @SrivastavaShubham99,

That is most probably because you are using abc123 as an event token value which is just a random value we pick when showcasing how event should be created. Instead of abc123, you should be using the actual event token value which you get when you create an event on dashboard.

SrivastavaShubham99 commented 4 months ago

I have taken this as an example from the code snippet provided in example : AdjustEvent myAdjustEvent = new AdjustEvent('abc123'); //... adjustEvent.setRevenue(0.01, 'EUR'); //... Adjust.trackEvent(myAdjustEvent);

Actually I want to track custom events can you please help me with that.

uerceg commented 4 months ago

In order for that to work, you need to:

  1. Create an app on Adjust dashboard.
  2. Instead of app token in the example app, use your own app token.
  3. Create an event for your app on Adjust dashboard.
  4. Instead of event token in the example app (abc123), use your own event token.
  5. And then run this test.
SrivastavaShubham99 commented 4 months ago

@uerceg so I have to create my event tokens on the Adjust dashboard and only then I can make use of those ? If so please tell me how to create event tokens on the dashboard as well. Basically I have to track events please suggest me correct way to do so.

uerceg commented 3 months ago

Hey @SrivastavaShubham99,

Sorry for the delay. Yes, that is correct. You need to create events in the Adjust dashboard and then you need to use the event tokens you get for the created events inside of your app and instantiate Adjust event with it.

When it comes to help around dashboard and navigating it, it would be for the best if you can ping your dedicated account manager in case you have one, or if not, just shoot an email to support@adjust.com and you're definitely gonna reach out people in there who can help you better when it comes to dashboard usage and navigation.

In case you have any other questions, feel free to ask.