Passing Dynamic Variables into Ad Requests
How to Use Custom Parameters in Ad Requests and Destination URLs
AdButler supports custom parameters in ad requests, allowing you to dynamically pass values through the ad request URL and into the ad's Destination URL using macro substitution. This is useful for tracking, personalization, and advanced targeting.
What Are Custom Parameters?
Custom parameters are user-defined key-value pairs that you can include in your ad request. These parameters can then be referenced using AdButler macros such as [CUSTOM_PARAM1]
, [CUSTOM_PARAM2]
, etc., inside your ad's Destination URL.
Step-by-Step: Passing and Using Custom Parameters
1. Add Custom Parameters to Your Ad Request
You can include up to five custom parameters in your ad request using the following format:
https://servedbyadbutler.com/adserve/;ID=YOUR_ZONE_ID;customParam1=value1;customParam2=value2;customParam3=value3;customParam4=value4;customParam5=value5
Each customParamX
parameter corresponds to a macro:
customParam1
→[CUSTOM_PARAM1]
customParam2
→[CUSTOM_PARAM2]
customParam3
→[CUSTOM_PARAM3]
customParam4
→[CUSTOM_PARAM4]
customParam5
→[CUSTOM_PARAM5]
Example
https://servedbyadbutler.com/adserve/;ID=123456;customParam1=blue;customParam2=canada
This would allow you to reference blue
using [CUSTOM_PARAM1]
and canada
using [CUSTOM_PARAM2]
.
2. Use the Custom Macros in the Destination URL
To make use of the custom parameter values, include the corresponding macros in your ad's Destination URL:
Example:
https://example.com/product?color=[CUSTOM_PARAM1]&country=[CUSTOM_PARAM2]
When the ad is served using the earlier ad request, the resulting click-through URL would be:
https://example.com/product?color=blue&country=canada
Notes and Best Practices
- These macros are evaluated at the time the ad is served.
- Always URL-encode parameter values when passing them into the ad request.
- If a macro is used in the Destination URL but its corresponding parameter is not present in the ad request, it will be replaced with a blank value.
- You can use a maximum of five custom parameters in a single ad request (
customParam1
throughcustomParam5
).
Additional Resources
- AdButler Advanced Macro Glossary
- How to Create a Zone Tag
- How to Set a Destination URL for an Ad Item
If you need help with dynamic parameters or advanced targeting strategies, feel free to reach out to our support team!