Campaigns
Campaign types
Full-stack
2 min
full stack a/b campaigns allow using personizely's js api to run custom changes right within your code configuration editing each variation opens up a view where you can enable or disable features and define parameter values that will later be used on the frontend usage to run the full stack campaign in your code, {{brand}} exposes the following functions ply runcampaign(id) this method runs a campaign and returns the campaign variation instance if not on control, and null if the user falls into the control group (make sure the campaign you are running is of a full stack type) id the campaign id (you can find it in the address bar when editing the campaign) variation getfeature(key) returns the feature instance within the variation key the feature key as specified when creating it feature isenabled() returns true or false depending on whether the feature is enabled for the current variation feature getparameter(key) returns the value of the parameter of the feature within the current variation key the key of the parameter as specified when defining the variation example const variation = ply runcampaign(1); // 1 is the campaign id if (variation) { const cartfeature = variation getfeature('cart'); // is the feature id/key if (cartfeature isenabled()) { const message = cartfeature getparametervalue('message'); // message is the feature parameter this notification queryselector(' cart notification heading') childnodes\[1] textcontent = message; } }