Can't get impressions by date

71 views
Skip to first unread message

javoeria

unread,
Oct 30, 2018, 7:37:56 PM10/30/18
to AdWords API and Google Ads API Forum
Hi, i'm trying to get the date of the first impression of a customer in Ruby but i always got a NameError.
The query is:  "SELECT date, metrics.impressions FROM customer ORDER BY date LIMIT 10"
I don't think that the query is wrong because i tried with "month" instead of "date" and it works.
Thanks.

Dannison Yao (AdWords API Team)

unread,
Oct 31, 2018, 2:17:30 AM10/31/18
to AdWords API and Google Ads API Forum
Hi,

Could you try using a date range in your query by inserting the query "WHERE date DURING LAST_7_DAYS" after the FROM clause? Refer to the sample working query I used below.

Query: SELECT date, metrics.impressions FROM customer WHERE date DURING LAST_7_DAYS ORDER BY date LIMIT 10

If this still does not work, could you provide the screenshot of your error via reply privately to author so I could investigate this further?

Regards,
Dannison
AdWords API Team 

javoeria

unread,
Oct 31, 2018, 7:49:19 AM10/31/18
to AdWords API and Google Ads API Forum
Hi Dannison,
Your query works fine but i need to check the dates from months or years ago of a customer, so it's not a good solution for me.
I check the error again and the error says: "NameError (uninitialized constant Google::Ads::GooglAads)"
This is probably a misspelling inside the gem, i have the last version 0.5.0
Thanks.
Message has been deleted

Luis Xander Talag (AdWords API Team)

unread,
Nov 5, 2018, 12:15:13 AM11/5/18
to AdWords API and Google Ads API Forum
Hi,

You could specify a custom date range for your query to narrow down the result. You may refer to below example for reference.

Query: SELECT date, metrics.impressions FROM customer WHERE date BETWEEN '2018-10-01' AND '2018-10-31' ORDER BY date ASC LIMIT 10

You may also check this guide for more information on date ranges. 

Let me know if it works.

Thanks and regards,
Luis
AdWords API Team

javoeria

unread,
Nov 5, 2018, 9:25:49 AM11/5/18
to AdWords API and Google Ads API Forum
It works, thanks!
Reply all
Reply to author
Forward
0 new messages