I'm looking for a way to automatically switch currency to GBP for users shopping in the UK with Google Shopping without reloading the page. The reason for this is due to the fact that any merchant feed listing that enters Google Shopping in a specific currency (for example GBP), must always automatically have that currency upon clickthrough regardless of the location the website is viewed in (Confirmed by Google Shopping).
This means that if your default store currency isn't GBP then google will flag your merchant listing for price discrepancy due to the fact all of the available automatic currency switcher apps available for Shopify first render the page in the default store currency prior to changing it and storing the country code in the cart_currency cookie.
so essentially I want to run a script that checks for a query string, finds currency, and sets the cart_currency cookie to GBP prior to the page loading, if the query string does not exist or does not contain a currency then it should run the below script which will change the currency based on IP location:
So basically it's checking "are you visiting from google shopping?" if yes "find currency from query string and set value in cart_currency cookie", if no "run automatic currency switcher app js"
Has anyone tried this before? essentially this should allow for automatic currency switching that is super fast if the person is visiting from Google Shopping, it also means that the price will always match the listing as the currency is passed directly through the query string directly from merchant center. Meaning I could set up a USD Merchant Center account and as long as my payment methods include USD the price and currency should match the merchant listing (USD).
If anyone can help out with the code that would be amazing as I think this can help a lot of businesses using their one site for global sales.