Documentation ¶
Index ¶
- func BucketUserToVariation(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign) (schema.Variation, error)
- func EvaluateSegment(vwoInstance schema.VwoInstance, segments map[string]interface{}, ...) bool
- func FindTargetedVariation(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign, ...) (schema.Variation, error)
- func GetBucketValueForUser(vwoInstance schema.VwoInstance, userID string, maxValue, multiplier float64, ...) (uint32, int)
- func GetBucketerVariation(vwoInstance schema.VwoInstance, variations []schema.Variation, bucketValue int, ...) (schema.Variation, error)
- func GetVariation(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign, ...) (schema.Variation, string, error)
- func GetVariationFromUserStorage(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign) (string, string)
- func GetWhiteListedVariationsList(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign, ...) []schema.Variation
- func IsUserPartOfCampaign(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign) bool
- func PreEvaluateSegment(vwoInstance schema.VwoInstance, segments map[string]interface{}, ...) bool
- func SegmentEvaluator(segments map[string]interface{}, customVariables map[string]interface{}) bool
- type VariationDecider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BucketUserToVariation ¶
func BucketUserToVariation(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign) (schema.Variation, error)
BucketUserToVariation validates the User ID and returns Variation into which the User is bucketed in.
func EvaluateSegment ¶
func EvaluateSegment(vwoInstance schema.VwoInstance, segments map[string]interface{}, options schema.Options) bool
EvaluateSegment function evaluates segmentation for the userID against the segments found inside the campaign.
func FindTargetedVariation ¶
func FindTargetedVariation(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign, options schema.Options) (schema.Variation, error)
FindTargetedVariation function Identifies and retrives if there exists any targeted variation in the given campaign for given userID
func GetBucketValueForUser ¶
func GetBucketValueForUser(vwoInstance schema.VwoInstance, userID string, maxValue, multiplier float64, campaign schema.Campaign) (uint32, int)
GetBucketValueForUser returns Bucket Value of the user by hashing the userId with murmur hash and scaling it down.
func GetBucketerVariation ¶
func GetBucketerVariation(vwoInstance schema.VwoInstance, variations []schema.Variation, bucketValue int, userID, campaignKey string) (schema.Variation, error)
GetBucketerVariation function returns the Variation by checking the Start and End Bucket Allocations of each Variation
func GetVariation ¶
func GetVariation(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign, goalIdentifier string, options schema.Options) (schema.Variation, string, error)
GetVariation function
Returns variation for the user for given campaign This method achieves the variation assignment in the following way: 1. First get variation from UserStorage, if variation is found in user_storage_data, return from there 2. Evaluates white listing users for each variation, and find a targeted variation. 3. If no targeted variation is found, evaluate pre-segmentation result 4. Evaluate percent traffic 5. If user becomes part of campaign assign a variation. 6. Store the variation found in the user_storage
func GetVariationFromUserStorage ¶
func GetVariationFromUserStorage(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign) (string, string)
GetVariationFromUserStorage function tries retrieving variation from user_storage
func GetWhiteListedVariationsList ¶
func GetWhiteListedVariationsList(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign, options schema.Options) []schema.Variation
GetWhiteListedVariationsList function identifies all forced variations which are targeted by variation_targeting_variables
func IsUserPartOfCampaign ¶
func IsUserPartOfCampaign(vwoInstance schema.VwoInstance, userID string, campaign schema.Campaign) bool
IsUserPartOfCampaign calculates if the provided userID should become part of the campaign or not
func PreEvaluateSegment ¶
func PreEvaluateSegment(vwoInstance schema.VwoInstance, segments map[string]interface{}, options schema.Options, variationName string) bool
PreEvaluateSegment function evaluates segmentation for the userID against the segments found inside the campaign.
func SegmentEvaluator ¶
SegmentEvaluator function evaluates segments to get the keys and values and perform appropriate functions
Types ¶
type VariationDecider ¶
VariationDecider struct