Apptimize recommends using a Dynamic Variable experiment (rather than a Code Block) when possible, so that you are able to take advantage of using the dashboard to change your variable values.
Dynamic Variables
- Much more robust and flexible
- Requires one time configuration in code
- Dynamic Variables are reusable
Allows the flexibility to add variants without the need for an app release
Best Practices
- Have consistent nomenclature: Make sure to give clear names to your variables so that the intention is clear in the dashboard. If you plan on using the variables cross-platform, ensure that you are using a consistent naming convention that works for variables in all your languages.
- Ensure Participation Occurs where the Dynamic Variable is called: Participation for a Dynamic Variable Experiment is triggered when the value method is called; therefore, call Dynamic Variable value method inline / as late as possible. Do not cache dynamic variable values; always retrieve them with the getter:
- Example:
- Setting up Dynamic Variables ahead of time: In most cases, you can guess whether a certain variable in the app would be suitable for testing in the future during feature development itself. Alternatively, it may be worth setting up early sessions with your product and development team to determine valid variables (and values for these variables) for experiments.
- For example: configurations or constants that you may want to change over time, feature toggles, etc.
- For example: configurations or constants that you may want to change over time, feature toggles, etc.
- Maintaining a repository of Dynamic Variables and associated values: It is a best practice to maintain a repository of Dynamic Variables that are present in the code and the valid values for these variables.
Code Blocks
- Blocks and functionality are pre-defined in app code
- Less room for human error in the dashboard
- Locks the experiment to a fixed number of variants
- Requires app release to add new variants
Best Practices
- Remove Code Blocks when they are no longer in use: After your experiment has finished and you have determined a winner variant, it is a best practice to gradually implement your winning variant in your app-code rather than having various code blocks existing throughout your codebase that may lead to clutter.
- Define your Code Blocks with appropriate names as they relate to their variants.
Comments
0 comments
Please sign in to leave a comment.