Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Unity Revenue Tracking

andrewt42147466
Level 1
Level 1

I can't seem to get any revenue tracking from my Unity app. The revenue documentation says to send a revenue event like:

  1. s.products="Mens;Shoes;1;35.99"
  2. s.events="purchase"

But the Unity plugin has a limited API, there really is only TrackState and TrackAction. I'm currently doing this:

  1. Dictionary<string, object> parms = new Dictionary<string, object>();
  2. parms.Add("products", string.Format("{0};{1};{2};{3}", productType, productId, quantity, dollarValue));
  3. ADBMobile.TrackAction("purchase", parms);

I can see all of the total occurrences of the "purchase action". And in my next release I will be adding an "events" parameter to try and match the documentation:

  1. parms.Add("events", "purchase");

Is there something else that I am missing? Should this be inside a call to TrackState? Is there something in the panel that I would need to set up in order for these events to register as revenue?

1 Accepted Solution
Asheesh_Pandey
Correct answer by
Community Advisor
Community Advisor

Hi Andrew,

I would use the following based on your code:

Dictionary<string, object> parms = new Dictionary<string, object>();

arms.Add("&&events","event1" ); //set custom events

parms.Add("&&products", string.Format("{0};{1};{2};{3}", productType, productId, quantity, dollarValue)); //set product string

ADBMobile.TrackAction("purchase", parms);

Thanks,

Asheesh

View solution in original post

4 Replies
Asheesh_Pandey
Correct answer by
Community Advisor
Community Advisor

Hi Andrew,

I would use the following based on your code:

Dictionary<string, object> parms = new Dictionary<string, object>();

arms.Add("&&events","event1" ); //set custom events

parms.Add("&&products", string.Format("{0};{1};{2};{3}", productType, productId, quantity, dollarValue)); //set product string

ADBMobile.TrackAction("purchase", parms);

Thanks,

Asheesh

View solution in original post

andrewt42147466
Level 1
Level 1

Thanks Asheesh, I will give that a try. Do you know why the "&&" characters are necessary?