Search


Search something to see results

VariationRule

A cookie variation rule determines the needed variation for the current request. See SpeedKitConfig.customVariation | the custom variation option for more information.

1.21.0

interface VariationRule {
    rules?: SpeedKitRule[];
    variationFunction: string | VariationFunction;
}

Index

Properties

Properties

rules?: SpeedKitRule[]

The rules to match only some resources.

[{ url: 'www.googletagmanager.com/gtm.js' }]

In this example, Speed Kit will apply the rule to determine the variation only for the Google Tag Manager request. All other resources will not be affected by this rule.

1.21.0

variationFunction: string | VariationFunction

The function to determine the variation for the requested resource. The function can also be declared as string representation. Parameters for the variation function are the current request, the device type and the cookies which are currently set. The output is a variation identifier for which a custom handling has to be implemented in the server runtime configuration.

1.21.0