Skip to content

Instantly share code, notes, and snippets.

@vwo-kb
vwo-kb / changeTimeDuration
Created September 9, 2019 08:25
Changing Timeout Duration
window.VWO = window.VWO || [];
window.VWO.push(['updateSPAWaitTime', < time_in_ms > ]);
@vwo-kb
vwo-kb / applyChangesManually
Created September 9, 2019 08:26
Apply changes manually
window.VWO = window.VWO || [];
window.VWO.push(['applyChanges', < Array_of_exp_ids > ]);
@vwo-kb
vwo-kb / revertCSSChangesManually
Created September 9, 2019 08:27
Revert CSS changes manually
window.VWO = window.VWO || [];
window.VWO.push(['revertChanges', < exp_id > ]);
@vwo-kb
vwo-kb / dynamicEventChanges
Created September 9, 2019 08:28
Applying Changes on Dynamic Elements
VWO.push(['refreshElements', < Array_of_selector_paths > , < exp_ids > ]);
@vwo-kb
vwo-kb / dynamicEventChangeExample
Created September 9, 2019 08:29
Dynamic Event Change Example
VWO.push(['refreshElements', ['#phone-name']]);
@vwo-kb
vwo-kb / applyDynamicChangesToWebsite
Created September 9, 2019 08:30
Code to apply changes on dynamic elements of the website:
/* CUSTOM CODE */
vwoRequestAnimationFrame = window.requestAnimationFrame || function(fun) {
setTimeout(function() {
fun();
}, 17)
}
vwoRequestAnimationFrame(function apply() {
// Change the below line with the action to be performed inside setInterval
VWO.push(['refreshElements', ['.hs-button']]);
vwoRequestAnimationFrame(apply);
@vwo-kb
vwo-kb / callingActivateManually
Created September 9, 2019 08:32
force the change by manually calling activate function in setinterval (Use this with precaution as it may cause the website to lag).
VWO.push(['activate', < should_keep_interval_running > ]);
@vwo-kb
vwo-kb / updateCustomURL
Created September 9, 2019 10:28
If actual URL is changing and you want to change the custom URL, use the following code snippet to update the custom URL
(function() {
window.VWO.push(['onEventReceive', 'uC', function() {
// Add your custom url here
window._vis_opt_url = ";
}]);
})();
@vwo-kb
vwo-kb / nonGTM.js
Created October 22, 2019 08:16
How to Integrate VWO with UA through a non-GTM Tag Manager
ga.getAll().forEach(function(e) {
if (e.get('trackingId') == 'UA-9679904-1') {
console.log(window.finalprefix = e.get('name'));
};
});
<script type = 'text/javascript' >
settings_tolerance = 2000,
library_tolerance = 2500,
</script>