Closed
Description
There is currently no support for multi currency in the magento google analytics module. It's a 1 minute change and should really be included as default as most stores will use Google analytics and if they have multiple currencies not having multicurrency support will skew their data.
In the google analytics module block Ga.php the below needs to be changed from
$result[] = sprintf(
"ga('ec:setAction', 'purchase', {
'id': '%s',
'affiliation': '%s',
'revenue': '%s',
'tax': '%s',
'shipping': '%s'
});",
$order->getIncrementId(),
$this->escapeJsQuote($this->_storeManager->getStore()->getFrontendName()),
$order->getBaseGrandTotal(),
$order->getBaseTaxAmount(),
$order->getBaseShippingAmount()
);
to
$result[] = sprintf(
"ga('ec:setAction', 'purchase', {
'id': '%s',
'affiliation': '%s',
'revenue': '%s',
'tax': '%s',
'shipping': '%s',
'currency': '%s'
});",
$order->getIncrementId(),
$this->escapeJsQuote($this->_storeManager->getStore()->getFrontendName()),
$order->getBaseGrandTotal(),
$order->getBaseTaxAmount(),
$order->getBaseShippingAmount(),
$order->getOrderCurrencyCode()
);