Unity Revenue Tracking

Avatar

Avatar

andrewt42147466

Avatar

andrewt42147466

andrewt42147466

07-05-2019

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?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Asheesh_P

MVP

Avatar

Asheesh_P

MVP

Asheesh_P
MVP

07-05-2019

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

Answers (3)

Answers (3)

Avatar

Avatar

Asheesh_P

MVP

Avatar

Asheesh_P

MVP

Asheesh_P
MVP

09-05-2019

Great...its a syntax.

Avatar

Avatar

andrewt42147466

Avatar

andrewt42147466

andrewt42147466

09-05-2019

This does appear to be working btw.

Avatar

Avatar

andrewt42147466

Avatar

andrewt42147466

andrewt42147466

08-05-2019

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