Function examples
Before working through these examples, you should be familiar with:
-
Lifecycle hooks — Input fields and output namespaces available at each lifecycle hook.
-
Function types and composition — How each function type works and its configuration fields.
-
Creating and managing — How to create functions and attach them to playback configurations.
This page provides complete, working function configurations for common use cases. Each example includes the scenario, the full configuration, the function mapping, and an explanation of what happens when the function runs.
| Example | Scenario description |
|---|---|
| Example 1: Data enrichment | Fetch a LiveRamp identity envelope at session start and store it in player parameters. |
| Example 2: A/B traffic split | Split ad request traffic evenly between two ad decision server URLs for A/B testing. |