Currency conversion

682 views
Skip to first unread message

Kirill Bochkanov

unread,
Apr 16, 2023, 5:46:08 AM4/16/23
to Google Ads Scripts Forum
Hello

Please tell me how can I convert dollars to euros in a script.

My account currency is USD. I want to convert CPC to EUR, how can I do that?

Nils Rooijmans

unread,
Apr 17, 2023, 1:51:48 AM4/17/23
to Google Ads Scripts Forum
when your account currency is USD , Google Ads script will return any cost or conversion value data in that currency.
In order to convert the USD number that is retrieved into another currency you would need to create a function that does so.
Ideally that function would call a 3rd party API that has the current exchange rate.
You can use this service to do so: https://fixer.io/

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum Advisor

unread,
Apr 17, 2023, 4:32:34 AM4/17/23
to adwords...@googlegroups.com

Hi All,

 

Thank you for reaching out to the Google Ads Scripts Team

 

@Nils - Thank you for your detailed response on this.

 

@Kirill - I would agree with Nils' previous response. A function or logic is needed to be set in place in order to convert the value from US dollars to the equivalent amount in euros. You could create a variable which would multiply the value with 0.91 in order to convert it to euros. I've also added a third party API below which you may also use in order to convert the value to euros.

 

Let us know if you have any clarifications.

 

Relevant links:

 

Best regards,

 

Google Logo Google Ads Scripts Team


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