Overview
To better understand where your customers are coming from and how they found your site, KnoCommerce allows you to pass click data and UTM parameters directly into your custom survey script via the customer_journey
object.
This enhances your survey analytics with valuable attribution insights—especially useful for analyzing first and last-touch marketing performance.
What Can Be Tracked?
The customer_journey
object supports data from both the first visit and last visit of the customer. Each visit can include standard UTM parameters and a source.
Here’s a breakdown of the accepted keys:
First Visit (First Touch)
source
utm_parameters
source
medium
campaign
content
term
Last Visit (Last Touch)
source
utm_parameters
source
medium
campaign
content
term
Note: Both first and last visit objects are optional, and you can include only the fields that are available.
How to Add It to Your Script
Inside your order
object in the KnoCommerce config, add a customer_journey
object like this:
"order": {
"id": '200',
"total_price": 25,
"currency": "USD",
"customer_journey": {
"last_visit": {},
"first_visit": {
"source": "direct",
"utm_parameters": {
"term": null,
"medium": "shopping",
"source": "google",
"content": "Example content",
"campaign": "Shopping"
}
}
}
}
Key Notes
null
values are acceptable where data is not availableIf
utm_parameters
or any nested fields are omitted, the script will continue to function without errorIf both
first_visit
andlast_visit
are empty or undefined, thecustomer_journey
object will simply be ignored
🛟 Need Help?
For support or further clarification, feel free to reach out:
📩 Email: hello@knocommerce.com
💬 Live Chat: Available in your KnoCommerce dashboard