Skip to main content

Currency Event

The currency tracking event tells PureClarity what currency is the user’s preference, and thus controls what currency is returned in product recommenders. The currency code must be a valid ISO 4217 currency code, (e.g. “USD”, “GBP” etc.). Prices in the currency must already be stored against the products as part of the data feed before sending the event.
This applies to client-side mode only. See server-side documentation on information on how to set the currency as part of the main request model.
PureClarity will not do exchange rate price conversion. The price for each currency supported by the site needs to be sent in the feed. See Data Feeds for more details. If this is not sent, the default currency set against your store view will be used. Also if currency is set, only products with that currency, sent in the product feed, will be shown.
If using server-side mode you will want to send this at the start of each new session if not displaying the default currency.

Value Format

The currency event takes a single string value containing a valid ISO 4217 currency code. Type: string Example values:
  • "USD" - US Dollar
  • "GBP" - British Pound
  • "EUR" - Euro
  • "CAD" - Canadian Dollar
  • "AUD" - Australian Dollar

Usage

Client-side Implementation

// Set currency to US Dollars
_pc("currency", "USD");

// Set currency to British Pounds
_pc("currency", "GBP");

// Set currency to Euros
_pc("currency", "EUR");

When to Send

Send the currency event:
  • When a user changes their currency preference on your site
  • At the start of a new session if the user has a saved currency preference
  • Before displaying any product recommenders with non-default currency

Important Notes

All prices for the specified currency must exist in your product feed. Products without prices for the selected currency will not be displayed in recommenders.
Valid ISO 4217 Currency Codes: View complete list of ISO 4217 currency codes