metrics.cost_micros vs google ads cost

669 views
Skip to first unread message

Jeffrey Liow Kah Seng

unread,
Sep 22, 2022, 10:59:21 AM9/22/22
to Google Ads API and AdWords API Forum
Hi, 

After I extracted the data through Stitch, there is only a column showing cost_micros. However, the cost does not tally with the UI of the google ads account. Anyone can advise which column can I use to get the exact cost?

Thanks.

Regards,
Jeffrey

Google Ads API Forum Advisor

unread,
Sep 22, 2022, 11:53:37 AM9/22/22
to jeffre...@carsome.com, adwor...@googlegroups.com
Hi Jeffery,

Thank you for reaching out to Google Ads API support with your question. 'cost_micros' is the cost with 6 decimals places of precision. This format is the most flexible as developers can round the number to the most appropriate decimal point. The currency type can be received from customer.currency_code from any resource that accesses the customer table. 

In light of the above, could you state in business terms the value of offering in the API a field that returns the cost exactly like in the UI and how you would use such a field?

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2eejUy:ref

Jeffrey Liow Kah Seng

unread,
Sep 22, 2022, 6:47:47 PM9/22/22
to Google Ads API Forum Advisor, adwor...@googlegroups.com
If I wish to match the figures as UI, how many figures should I round up, although I have divided by 1000000, but the figures still unable to match

发件人: Google Ads API Forum Advisor <ads...@forumsupport.google>
发送时间: Thursday, September 22, 2022 11:53:17 PM
收件人: jeffre...@carsome.com <jeffre...@carsome.com>
抄送: adwor...@googlegroups.com <adwor...@googlegroups.com>
主题: RE: metrics.cost_micros vs google ads cost
 

Google Ads API Forum Advisor

unread,
Sep 22, 2022, 10:56:23 PM9/22/22
to jeffre...@carsome.com, adwor...@googlegroups.com
Hi Jeffrey,

Thank you for providing updates to your concern.

To further investigate the issue, could you provide the following details that show that data discrepancy in terms of cost?
You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2eejUy:ref

Jeffrey Liow

unread,
Sep 23, 2022, 3:50:29 AM9/23/22
to Google Ads API Forum Advisor, adwor...@googlegroups.com

Hi Support,

 

Noticed that there I google ads query builders, how can I extract my ads data by using the SQL query?

For example, I would like to extract the campaign column and cost column from my ads account. For the UI interface, when I select two dates, it will combine the cost together.


Thanks.

Regards,

Jeffrey

Google Ads API Forum Advisor

unread,
Sep 23, 2022, 5:20:22 AM9/23/22
to jeffre...@carsome.com, adwor...@googlegroups.com
Hi Jeffrey,

Thank you for raising your concern to my team.

It appears that you are asking the GAQL to get the cost at the campaign level with the campaign name. With this, try using the simple query below:
SELECT campaign.name, metrics.cost_micros FROM campaign WHERE segments.date >= 'Min date in this format YYYY-MM-DD' AND segments.date <= 'max date in this format YYYY-MM-DD'

Jeffrey Liow

unread,
Sep 23, 2022, 5:23:51 AM9/23/22
to Google Ads API Forum Advisor, adwor...@googlegroups.com

Hi,

 

I know how to query actually, just not sure where can I query, can you give me the link to query and extract data?

Thanks.

 

From: Google Ads API Forum Advisor
Sent: Friday, 23 September, 2022 5:20 PM
To: jeffre...@carsome.com
Cc: adwor...@googlegroups.com

Google Ads API Forum Advisor

unread,
Sep 23, 2022, 8:01:02 AM9/23/22
to jeffre...@carsome.com, adwor...@googlegroups.com

Hi Jeffrey,

Thank you for the reply.

Suppose you have GAQL, and looking to get the data for said GAQL. To issue this request, pass the GAQL to the GoogleAdsService.SearchStream interface.

If you are using REST, then you may use below cURL to get the data

Here is a complete example of the report definition above, enclosed in an HTTP POST request.
 
 
POST /v11/customers/{customer_id}/googleAds:searchStream HTTP/1.1
Host: googleads.googleapis.com
User-Agent: curl
Content-Type: application/json
Accept: application/json
Authorization: Bearer [Enter OAuth 2.0 access token here]
developer-token: [Enter developerToken here]
 
Parameters:
{
  "query" : "SELECT campaign.name, campaign.status, segments.device,
                    metrics.impressions, metrics.clicks, metrics.ctr,
                    metrics.average_cpc, metrics.cost_micros
            FROM campaign
            WHERE segments.date DURING LAST_30_DAYS"
}

If you're looking to run the reports using the client library, then you may use your GAQL with this code example.

Let us know if this helps.

Best regards,

Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2eejUy:ref
Reply all
Reply to author
Forward
0 new messages