In this article, you’ll learn the following:
|
NOTE: This article explains a feature present in Shopify's VWO app for integration that simplifies checkout extensibility.
While configuring Shopify’s VWO app to import standard Shopify events into your VWO account, you will have to simply enable the access for VWO to connect to your Shopify account and enable the transit of the events from your Shopify account. While doing so, you can also customize these events so as to change their names and properties, as required.
Adding Code Customization
To make these customizations, select the Yes, I'd like to customize event payload according to my preferences. option under Advanced code option.
By doing so, a code editing section to include the code customization appears. The customization you apply here will be applied to the event that is specified in it. You can enter as many codes as required and click Save.
Things to Remember
- An event payload consists of only 2 fields - event name and event properties.
- Do not remove the payload.name field in the custom code as it represents the event name.
- Ensure that you add a return statement at the end of your custom code; otherwise, the updated payload will not be populated in VWO.
Custom Code Syntax
Typically, your custom code should have the following syntax:
Use Cases
Avoiding duplicate event names: If you’ve already imported an event with the name “shopify.checkout”, and now you’re trying to import another set of events, which also has an event with the same name, you can rename your new event to avoid confusion.
You can rename an event by customizing the required code, as shown in the following example:
Enhancing event capabilities: If you need to convert the currency of multiple locales, you can configure the Purchase event to set up multi-currency conversion. This will display all your revenue conversions in your desired currency.
You can apply the multi-currency setup to the Purchase event (shopify.purchase) by adding the following code: