Unity Revenue Tracking | Community
Skip to main content
May 7, 2019
Solved

Unity Revenue Tracking

  • May 7, 2019
  • 4 replies
  • 1452 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asheesh_Pandey

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

4 replies

Asheesh_Pandey
Community Advisor
Asheesh_PandeyCommunity AdvisorAccepted solution
Community Advisor
May 8, 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

- Asheesh
May 8, 2019

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

May 9, 2019

This does appear to be working btw.

Asheesh_Pandey
Community Advisor
Community Advisor
May 10, 2019

Great...its a syntax.

- Asheesh