Unlock the full potential of your checkout data with ThriveCart Custom Variables. Whether you’re passing customer information through your checkout URL, embedding data on your site, or sending details via ThriveCart Webhooks or Zapier, custom variables give you powerful control over the data shared between systems.
By using the ThriveCart query string, you can pass data through the checkout URL seamlessly and capture it for use on your success pages, in your ThriveCart API integration, and beyond—helping you track, personalize, and automate every step of the customer journey.
How to get started with custom variables
Passing custom variables through the checkout URL is similar to having hidden fields to collect data. This information will be associated with the customers order and included in:
- The query-string on a custom success page
- Webhook data
- Zapier data
- API data
In this example, your checkout URL is http://abc.thrivecart.com/example-product/ (you would replace this with the real URL to your product).
Step 1: Specifying the variable(s)
You would need to append the variables to the end of your checkout URL. An example of a variable would look like this:
?passthrough[example_key]=example_value
You could have multiple variable passed through and you would put these together like any other query-string, for example:
?passthrough[example_key]=example_value&passthrough[another_key]=another_value
So adding this to a checkout URL, you’d now have something like;
http://abc.thrivecart.com/example-product/?passthrough[example_key]=example_value
Step 2: Checkout process
As your customer completes their order, this information is passed through and associated in the background with their order information. They won’t have any input or control over these variables, and these variables are not included on invoices or receipts.
Step 3: Your success page
When redirecting to a custom success page, you will receive your key and value pairings as query-string variables in the URL. You can then use a script on your site to use these based on your specific needs.
For example, you could access them by using $_GET in your PHP script.
<?php $example_key = $_GET['example_key']; // In the example, this will be set to 'example_value' ?>
Please note that any custom pass through information is not included in the hash used to validate the order.
Embeddable checkouts
You can still use the passthrough functionality on a page where you have embedded a checkout on your site. The same process applies where you can either add the variables to the URL where the cart is embedded OR you can inject and handle this directly within the code of the embeddable cart.
You’d need to add the following to the <div> for the embeddable cart.
data-thrivecart-querystring="passthrough[example_key]=example_value"
So, a full embed code would look something like this:
<div data-thrivecart-account=“abc” data-thrivecart-tpl="v2" data-thrivecart-product=“1” class="thrivecart-embeddable" data-thrivecart-embeddable="tc-abc-1-QDGLYT" data-thrivecart-querystring="passthrough[example_key]=example_value"></div> <script async src="//tinder.thrivecart.com/embed/v1/thrivecart.js" id="tc-abc-1-QDGLYT"></script>
You or your developer could dynamically generate the content within this script based on your specific requirements and what you’re looking to pass through on your checkout page (if it’s not a fixed value).
Frequently Asked Questions (FAQs)
- Q: Can I use passthrough variables to pre-fill the checkout form?
- A: Yes, you can! We have an article detailing all of the form field variables here, but things like customer name, email, address, and even custom fields can be used to automatically pre-fill known customers information in the checkout.
- A: Yes, you can! We have an article detailing all of the form field variables here, but things like customer name, email, address, and even custom fields can be used to automatically pre-fill known customers information in the checkout.
- Q: How can I build a script to read those passthrough variables?
- A: You’ll want to work with a developer on your side to build out that script based on your specific requirements and site host, but you can see an example script used to access order information here. You’ll just want to make sure that you’re setting the variables you used in your script.
Related Articles
- UTM Tracking
- Setting your after order success/thank you page
- Using webhook notifications
- Creating your first Zap in Zapier
- Pre-fill your checkout fields
- Accessing order information via the query string
- Exclude PII (customer information) from the query string
- Custom fields
- Creating your ‘main’ products