(() => {
pixery.initialize("CLONEAI");
pix.inputs.set("abTestGroupId", document.getElementById("abTestGroup").getAttribute("data-element-id"));
document.getElementById("abTestGroup-container").style.display = "none";
const url = pixery.BASE_URL + '/funnel/ab-test/assignments';
const options = {
method: 'POST',
headers: pixery.getHeaders(),
body: JSON.stringify({
funnelFoxSessionId: new URLSearchParams(window.location.search).get("psid"),
abTestKey: "cloneai_three_month_test_bd_us",
countryCode: pixery.getCookie("ff-country"),
userAgent: navigator.userAgent
})
};
pixery.requestWithRetry(url, options)
.then(response => response.json())
.then(result => {
console.log('AB Test Response:', result);
const isAbTestActive = result.assigned;
const group = result.groupKey;
const id = pix.inputs.get("abTestGroupId");
pix.state.set(id, {type: 'Text', form: id, value: group});
})
.catch(error => {
console.error('Error in AB test:', error);
});
})();