Do you have metrics with multiple currencies? Here’s one way to convert them in real time on your metrics.

In your metric, add a new report and select Custom Rest API for the data source.

In the Data Settings for the new report, enter the following:

URL: http://api.fixer.io/latest?base=USD

  • Note: change the base code (what comes after base=) to whatever three-letter code represents the currency you want to convert to.

Headers

  • Key: date
  • Value: {{'YYYY-MM-DD'}}

Check the Advanced options box, and make sure the Request method is set to GET. You will also want to check the Rotate table data checkbox.

If you press connect, this will give you the following chart:

Then, by using a substring, we can extract the date line and column A to just the three-letter currency code.

In the SQL transformer in the left-hand pane, enter the following SQL in, then press Connect:

SELECT SUBSTR(base,7,3) as currency, AUD as conversion_value
FROM report
WHERE base <> 'date'
 

And that should give you a chart similar to this:

This will allow Grow to match up the currency conversion in this report with the currencies in your original report.

To finish this out, go ahead and use a Joined Report to join the two and display the converted currencies with your original data.

And that’s it! You’re good to go.

Questions? Email us at support@grow.com or chat in on the site.

Did this answer your question?