Skip to content

Instantly share code, notes, and snippets.

using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using System.Text.RegularExpressions;
namespace YourApplication.Controllers {
public class CookiesController: Controller {
[HttpGet]
public IActionResult SyncCookies() {
app.UseMvc(routes => {
routes.MapRoute("cookies", "sync", defaults: new {
controller = "Cookies", action = "SyncCookies"
});
});
@vwo-kb
vwo-kb / vwoSPACode
Last active December 21, 2019 21:51
Async VWO Smartocode
<!-- Start VWO Async Smartcode -->
< script type = 'text/javascript' > window._vwo_code = window._vwo_code || (function() {
var account_id = < YOUR_ACCOUNT_ID > ,
settings_tolerance = 2000,
library_tolerance = 2500,
use_existing_jquery = false,
is_spa = 1,
hide_element = 'body',
/* DO NOT EDIT BELOW THIS LINE */
f = false,
@vwo-kb
vwo-kb / customURLForSPA
Created September 9, 2019 08:23
Using Custom URLs for SPA
window.VWO = window.VWO || [];
window.VWO.push(['activate', {
customUrl: 'http://mycustomurl.com/custom-url'
}]);
@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);