Community Discussion

Ask a Question
Back to All

Calculating the Publisher spend for the last 24 hours


For our requirements, in each account I need the last 24 hours' spend per Publisher.

With the Java SDK, I can easily get the spend per site in daily chunks using the SITE_BREAKDOWN dimension, however this doesn't support anything finer-grained, for instance if I want to know the spend from midday yesterday until midday today.

It doesn't look possible through the Java SDK.

I've also looked at calling the Backstage API directly, but even then it looks like I can only perform what I need one site per call using campaign_hour_breakdown with a site filter...<account>/reports/campaign-summary/dimensions/campaign_hour_breakdown?start_date=2021-02-08&end_date=2021-02-09&site=<site name>

Our app can then aggregate the values in the response to calculate our spend on a site for the last 24 hours.

Given that we are using thousands of Publishers, this could take some time!

I'd love to know if there another more performant way of doing this?