Attach custom metrics to HitBuilders.TransactionBuilder in Android Analytics v4

How can I add a HitBuilders.TransactionBuilder value to a custom metric as follows? I want to associate a transaction with a value.

tracker.send(new HitBuilders.TransactionBuilder() .setOtherAttributes(...) .setCustomMetric(1, 10) .build());

The rest of the data was sent successfully, but the user metric is always 0.

+5
source share
3 answers

The problem was that the custom metric area was not deleted and that I was looking at my own report widget that matches the product. The value appeared when I changed the column.

0
source

It seems your code is correct. You can try setCustomDimension instead of setCustomMetric, you need to convert float to string.

0
source

Your code is correct. What you need to check are the server side reports that you create.

Make sure you create custom metrics in Admin - Custom Definitions - Custom metrics. After creation, custom metrics will initially be displayed with a delay of 3 to 4 hours on the server. Give them some time to appear there. Finally, you need to create a report to see the result. Make sure that you select the correct time intervals and do not add too many indicators and filters, otherwise you will not see the data. Make the first repetitions as simple as possible. Hope this helps.

0
source

All Articles