First, the basics: What's a query string?
A query string is an extra bit of information that can be added to a web address in the format of ?some_field_name=value
. Where some_field_name
is the field's name (ex. customer_name), and value
is the data you want to pass to that field (ex. Johnny).
For example, let's look at this booking URL. It has a query string (bolded) that automatically fills in the ZIP code with that preselected value when someone books from that link:
https://widget.zenbooker.com/book/manymaids?postal_code=20901
If you want to include multiple query strings in the same URL, just add an &
between the additional query strings.
For example:
https://widget.zenbooker.com/book/manymaids?postal_code=20901&coupon_code=spring-clean
Passing data to your booking form via query strings
You can easily prefill fields on the booking form by adding query strings to the URL of your booking page or adding them to one of your website pages with the booking widget embedded.
For example, let's say you have an embedded booking widget on your page at example.com/book-online and want to share a link with a prefilled coupon.
You can do this by simply sharing a link that adds the ?coupon_code=
query string. So it would be: example.com/book-online?coupon_code=spring-clean
The embedded booking widget will automatically detect the query string and pass it along to the booking form.
Supported query strings for prefilling data on the booking form
Field name | Description | Example |
postal_code | Prefills the postal code input for the service area check |
|
service_address | Prefills the customer's service location in the address field. |
|
service_address_unit | Prefills the customer's apt/unit/floor field in the address field. Only works when also used with the service_address parameter. |
|
coupon_code | Automatically applies a coupon code if a valid code is passed |
|
customer_name | Prefills the customer name field on the last page of the booking form |
|
customer_phone | Prefills the customer phone number field. Important: Don't include the country calling code prefix in the phone number you pass - e.g., use 3015551234 instead of 13015551234 |
|
customer_email | Prefills the customer email address field |