SummaryRow data differs when segments.date is or isn't requested

307 views
Skip to first unread message

Tiana S.

unread,
Dec 7, 2021, 3:09:18 AM12/7/21
to AdWords API and Google Ads API Forum
Hi there,

We're noticing some odd behavior from the API and are wondering if this is intended.

Basically, the data returned in the SummaryRow is different depending on whether or not `segments.date` is requested.

Body of request with segments.date:
body: { query: "SELECT segments.date,metrics.average_time_on_site,metrics.clicks FROM campaign WHERE metrics.impressions > 0 AND segments.date >= '2021-11-01' AND segments.date <= '2021-11-30'", summary_row_setting: 'SUMMARY_ROW_ONLY' },

Result for that request:
{ "fieldMask": "segments.date,metrics.averageTimeOnSite,metrics.clicks", "summaryRow": { "metrics": { "clicks": "1184", "averageTimeOnSite": 169.47696038803556 } } }


Body of request without segments.date:
body: { query: "SELECT metrics.average_time_on_site,metrics.clicks FROM campaign WHERE metrics.impressions > 0 AND segments.date >= '2021-01-01' AND segments.date <= '2021-11-30'", summary_row_setting: 'SUMMARY_ROW_ONLY' },

Result for that request:
{ "fieldMask": "metrics.averageTimeOnSite,metrics.clicks", "summaryRow": { "metrics": { "clicks": "18518", "averageTimeOnSite": 171.40262230514097 } } }

The queries are exactly the same, only with and without the field `segments.date` in the SELECT. Is this behavior expected?

Thanks,

Tiana

Google Ads API Forum Advisor

unread,
Dec 7, 2021, 4:44:31 PM12/7/21
to ti...@swydo.com, adwor...@googlegroups.com

Hello Tiana,

Thanks for reaching out to the Google Ads API support. There are few segmentation rules under date segment fields, these rules need to be followed to get the expected data. If you want to ‘segment.date’ on the SELECT clause, then the same segments must be specified in the WHERE clause as well. Also the segment.date can be filtered in the WHERE clause without appearing in the SELECT clause.

Please try either way following the segmentation rules and let us know how it goes.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey

Google Logo
Jakeia Sabrina
Google Ads API Team
 

ref:_00D1U1174p._5004Q2SchNn:ref

Tiana S.

unread,
Dec 8, 2021, 7:32:15 AM12/8/21
to AdWords API and Google Ads API Forum
Hi Jakeia,

Thanks so much for your help!

I checked the documentation you sent, but seeing the queries I sent initially it looks like I'm already following the rules as outlined there.
I'm already including `segments.date` in the WHERE clause, for both requests with and without the segment in the SELECT clause.

Is there anything I'm missing?

Thank you,

Tiana

Google Ads API Forum Advisor

unread,
Dec 9, 2021, 4:07:28 AM12/9/21
to ti...@swydo.com, adwor...@googlegroups.com

Hi Tiana,

Thanks for getting back to us.

I’ve checked the GAQL used in your initial thread. It appears that the segments.date >= '2021-11-01' AND segments.date <= '2021-11-30' in the where clause are mismatching the GAQL used without segments.date. I’ve tried to generate the same report, and I was able to get the same data returned in the SummaryRow. That said, you may retry generating the report keeping the same segments.date >= '2021-11-01' AND segments.date <= '2021-11-30' in your where clause for SummaryRow results, and let us know the results.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2SchNn:ref

Tiana S.

unread,
Dec 13, 2021, 8:04:21 AM12/13/21
to AdWords API and Google Ads API Forum
Hi Yasar,

Thanks for looking into this! That must have been the issue because I cannot reproduce it anymore after fixing the dates.
Sorry about that, and thank you for your help!

Best,

Tiana
Reply all
Reply to author
Forward
0 new messages