This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"properties": { | |
"experimentId": "102", | |
"VariationId": "1", | |
"CampaignName": "Hero Section - A/B", | |
"variationName": "Control" | |
}, | |
"event": "VWO", | |
"type": "track" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If VWO is not going to redirect the page | |
if (!window.willRedirectionOccurByVWO) { | |
//EXECUTE GA CODE HERE | |
} else { | |
// VWO is redirecting this page. So, don't execute UA/GA code here. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ABCD1EFG2H"></script> // In the case of GA4, this script should be loaded, replacing G-ABCD1EFG2H with your GA4 measurement ID. | |
<script> | |
(function(nonVWOScriptsToExecute, VWO_HARD_TIMEOUT) { | |
window._vwo_evq = window._vwo_evq || []; | |
var queue = window._vwo_evq; | |
for (var i = 0; i < queue.length; i++) { | |
if (queue[i][0] === 'rD') { | |
window.willRedirectionOccur = true; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Set variables (must be uppercase) | |
SET VWO_ROLE = 'VWO_ROLE'; | |
SET VWO_USERNAME = 'VWO_USER'; | |
SET VWO_WAREHOUSE = 'VWO_WAREHOUSE'; | |
SET VWO_DATABASE = 'VWO_DATABASE'; | |
SET VWO_SCHEMA = 'VWO_SCHEMA'; | |
-- Set user password | |
SET VWO_PASSWORD = 'secure_password'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToDefaultCurrency(amount, fromCurrency, precision = 2) { | |
/** | |
* Your array of currencies and their conversion rates relative to the default currency | |
* Example: If USD is your store currency or the one in which you want to track revenue and | |
* 1 USD = 0.8 GBP then the entry in the array will be "GBP": 0.8 | |
**/ | |
var currencyConversion = { | |
"USD": 1,// Always keep the default store currency in the array and keep the value as 1 | |
"EUR": 1.1, | |
"GBP": 0.82, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vwo.addShopifyMiddleware((payload) => { | |
let newPayload = payload; | |
if(payload.name == "shopify.productViewed"){ | |
newPayload.name = "newShopifyEventName" ; | |
} | |
return newPayload; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vwo.addShopifyMiddleware((payload) => { | |
let newPayload = payload; | |
// customCode logic here | |
return newPayload; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payload = { | |
name: “shopify eventName” // mandatory field | |
props: { | |
// properties to be shown in VWO’s Events | |
} | |
} |
NewerOlder