Important Rules:
- Maintain the original formatting (markdown, HTML tags, links, etc.)
- Keep technical terms and proper nouns as appropriate
- Preserve code blocks and technical syntax exactly
- Maintain the same tone and style
- Only output the translated text, no explanations or comments
When analyzing and visualizing data for e-commerce websites, many different contexts must also be considered. For instance, if a store supports multiple currencies, currency and exchange rate settings become priority areas for inspection. In this article, I will share some observations regarding this process.
Customers often assume that discrepancies between e-commerce platform (such as WooCommerce, Shopify, etc.) reports and GDS or GA4 reports are due to incorrect data transmission. However, when reviewing past transactions via Google Tag Manager, it becomes evident that the transaction amounts reported are indeed the expected values. So, in this situation, what questions should be asked and what controls should be implemented?
For the following examples, I used a Shopify store as a base and attempted to explain various topics within this example framework. Therefore, while certain topics may differ across e-commerce platforms, I assume that the process of generating solutions will share similarities.
One of the situations I frequently encounter in Shopify stores, particularly, is the use of multiple currencies1 and its reflection in GA4 e-commerce reports. On the other hand, when it comes to GA4, if the currency defined for a property differs from the currency defined for the e-commerce store, similar results can occur. Describing this situation as a problem is difficult, as the services involved in the process are actually performing the behaviors expected of them. Nevertheless, of course, this inconsistency among services leads to corrupted data and, consequently, to erroneous analyses.
GA4 Currency and Exchange Rate
IMPORTANT RULES:
- Maintain the original formatting (markdown, HTML tags, links, etc.)
- Keep technical terms and proper nouns as appropriate
- Preserve code blocks and technical syntax exactly
- Maintain the same tone and style
- Only output the translated text, no explanations or comments
If you’re using tools such as Universal Analytics (UA) or Google Analytics 4 (GA4) to track user and e-commerce activities, you’ve likely noticed that these tools request time zone and currency settings at either the property or account level. For example, the following screenshot displays the time zone and currency fields available for GA4 properties and will be used in the corresponding property reports.
By default, the global currency type for a property or report view is USD 2.
The selected currency refers to the currency of the transaction. If a transaction has occurred, check the currency associated with that transaction. If the currency value matches, pass that value to the reports. However, if a different currency is involved, convert that value to the property’s designated currency using the exchange rate determined for that day, and include it in the reports.
Changes to the global currency type affect both past and future data. Previous data will be converted to the new currency configuration 2.
Even if the currency setting for a property matches the one provided, Analytics performs a conversion for all activities involving currencies other than USD. This conversion is re-run every time a report is generated. Due to daily fluctuations in exchange rates, minor discrepancies may appear in your local currency within the reports 2.
If we summarize the areas where this process is implemented, they are as follows:
- Purchase Revenue
- Tax
- Shipping
- Item Revenue
- Transaction-Level Revenue
- Total Value
Below you will find the Enhanced Ecommerce snippet for the purchase event, applicable to both GTAG and GTM. You can view the currency-related parameters (currency and currencyCode) in both cases 3.
// GTAG
gtag('event', 'purchase', {
transaction_id: 'T_12345',
value: 25.42,
tax: 4.90,
shipping: 5.99,
currency: 'EUR',
items: [{...}]
});
// GTM
dataLayer.push({ ecommerce: null });
dataLayer.push({
'ecommerce': {
'currencyCode': 'EUR',
'purchase': {
'actionField': {
'id': 'T12345',
'revenue': '35.43',
'tax': '4.90',
'shipping': '5.99',
},
'products': [{...}]
}
}
});
If data is being passed through GTM, the currency information can also be sent as part of the event parameter.
Now, let’s go through an example. In our GA4 property, we use EUR, while our e-commerce platform uses multiple currencies or a different currency than that used in GA4.
In this case, the amounts sent will be processed according to the exchange rates determined by Google and will be displayed in the reports. Let’s now elaborate on this example. Suppose the currencies available in our e-commerce platform are as shown in the following image.
In this scenario, the transaction is processed according to exchange rates in both the e-commerce platform and in GA4 reports. If Shopify is used as the e-commerce platform, the relevant details are provided as transaction details. However, on the GA4 side, direct access to the exchange rate information is not possible, and minor differences may typically be observed between the e-commerce platform and GA4.
So, what can be done in this situation?
Shopify order values reflected in GA4 reports and transaction amounts sent to GA4 via the GTM Preview Mode can be presented in a table, allowing us to examine whether the discrepancies between the values follow a pattern.
For example, let’s assume there is a difference of 0.77 between CAD and USD. In this case, the variation ratio in the table will be approximately 0.7. Now let’s present this as a table.
| Order ID | GA4 Transaction Amount | Shopify Transaction Amount | Difference | Difference Ratio |
|---|---|---|---|---|
| 1 | 33.13 | 42.63 | 9.5 | 0.777 |
| 2 | 23.34 | 30.03 | 6.69 | 0.777 |
| 3 | 58.28 | 74.98 | 16.7 | 0.777 |
| 4 | 36.40 | 46.83 | 10.43 | 0.777 |
| 5 | 25.16 | 32.54 | 7.38 | 0.773 |
| 6 | 10.55 | 13.65 | 3.10 | 0.773 |
| 7 | 32.08 | 41.46 | 9.38 | 0.774 |
| 8 | 33.26 | 42.79 | 9.53 | 0.777 |
| 9 | 10.85 | 13.96 | 3.11 | 0.777 |
| 10 | 20.51 | 26.51 | 6.00 | 0.774 |
So, is there a possibility of evaluating such situations in advance?
Absolutely.
However, I’d like to highlight a practical insight that can be applied during the process of tabulating currency discrepancies.
Google Sheets provides us with the GoogleFinance function, enabling us to display and perform operations on currency and market data within spreadsheets4. As shown in the image below, we can automatically list daily exchange rate changes within the specified date range5.
The textual form of the formula shown in the image: =GoogleFinance("CURRENCY:"&$A$2&$B$2, "price", TODAY()-$C$2, TODAY()).
This currency information can be included in rows, enabling a quick comparison of currency differences between Shopify and the current rates.
Custom Dimension - Currency
Since the currency is passed with each transaction, when enabled via reports, the relevant currency can be displayed. This makes it easier to determine which currency was used for the transaction and to compare it against the exchange rate at the transaction date. Customers can also examine the reasons behind any discrepancies within this contextual framework.
To enable the relevant dimension (dimension), follow the steps Configure > Custom definitions > Create custom dimension and enter currency in the corresponding fields.
virtual_currency_name is a different metric used for transactions involving virtual currencies6.
Custom Metrics
Let’s proceed with Shopify for this recommendation. Shopify provides us with {{ shop.currency }}, {{ cart.currency }}, and {{ checkout.currency }} in Liquid files, as well as Shopify.currency.active in JavaScript code, and Shopify.checkout.currency on the order status page, which provides the currency currently used and active by the store. Thus, the currency used in transactions can be passed to GA4. With the inclusion of the currency dimension in reports, the exchange rate associated with each transaction amount can be displayed. However, Shopify also provides us with the exchange rate of the currency via window.Shopify.currency.rate.
If the currency in which the transaction was conducted matches the selected currency, or if a different currency is not in use, the window.Shopify.currency.rate value will be 1.0.
This information can also be reported as a custom metric, enabling us to view currency and exchange rate differences through reports rather than directly inspecting order details.
On the other hand, the transaction amount can also be passed through a separate metric. The numerical values preserved as custom metrics remain outside of this process, while the fields specified under the GA4 Currency and Exchange Rate section are automatically processed based on exchange rate information. This allows for clear visibility into the differences between the values passed and those reflected in the reports.
Now let’s examine all these details through the code snippets I shared at the beginning of the article.
// GTAG
gtag("event", "purchase", {
transaction_id: "T_12345",
currency_rate: window.Shopify.currency.rate,
value: 25.42,
tax: 4.90,
shipping: 5.99,
currency: "EUR",
items: [{...}]
});
// GTM
dataLayer.push({ ecommerce: null });
dataLayer.push({
'ecommerce': {
'currencyCode': 'EUR',
'purchase': {
'actionField': {
'id': 'T12345',
'revenue': '35.43',
'value': '35.43',
'currency_rate': window.Shopify.currency.rate,
'tax':'4.90',
'shipping': '5.99',
},
'products': [{...}]
}
}
});
As observed, two new parameters—value and currency_rate—have been added, depending on the data layer format. After defining currency_rate as a custom dimension, we can begin displaying these values alongside transaction amounts in relevant reports. In addition to the Revenue column, the Event Value field is also included, allowing for clear visualization of any discrepancies in monetary values.
With these implemented processes, you can now handle currency and exchange rate-related operations in a much more practical way and begin leveraging the relevant data across different audience segments and user groups.
Footnotes
- ISO 4217. Wikipedia ↩
- Currency reference. Analytics Help ↩ ↩2 ↩3
- Enhanced Ecommerce for Tag Manager. Google Developers, Measure ecommerce. Google Developers, Google Analytics 4 Events. Google Developers, Enhanced ecommerce. Google Developers ↩
- GOOGLEFINANCE. Google Docs Editors Help ↩
- Euro to Hong Kong dollar. Google Finance ↩
- Recommended events. Analytics Help, earn_virtual_currency, spend_virtual_currency ↩