- Kameleoon アカウント にログインします。
- Admin > Projects をクリックします。
- Web サイトカードの Configuration をクリックします。

- 上記のスクリプトを Variation selection script フィールドに追加します。

Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
一意のユーザー ID を使用して、認証済みユーザーにデバイスを越えて一貫したバリエーションを提供するため、Kameleoon のデフォルトのバリエーション割り当てをオーバーライドする方法。
function (experiment)
{
var registeredVariationId;
var deviationRandom = experiment.obtainVariationAssignmentRandomNumber();
var total = 0.0;
for (var i = 0, l = experiment.variations.length; i < l; ++i)
{
total += experiment.variations[i].deviation;
if (deviationRandom <= total)
{
registeredVariationId = experiment.variations[i].id;
break;
}
}
return registeredVariationId != null ? registeredVariationId : "none";
}
function(experiment)
{
var memberId = window.member_id.toString(); //CODE to update with your variable that contains the unique identifier. It has to be available before calling the Kameleoon snippet
memberId = memberId + experiment.id.toString();
var hash = 0;
for (i = 0; i < memberId.length; ++i)
{
char = memberId.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash = hash & hash;
}
hash = (Math.abs(hash) * 9301 + 49297) % 233280;
var deviationRandom = hash / 233280;
var total = 0.0;
for (var i = 0, l = experiment.variations.length; i < l; ++i)
{
total += experiment.variations[i].deviation;
if (deviationRandom <= total)
{
chosenVariationId = experiment.variations[i].id;
break;
}
}
return registeredVariationId != null ? registeredVariationId : "none";
}


このページは役に立ちましたか?