Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Unity Revenue Tracking

Avatar

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

Avatar

Correct answer by
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

Avatar

Correct answer by
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

Avatar

Level 1

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

Avatar

Level 1

This does appear to be working btw.