Metadata
Optional context you can attach to any response.
Problem: You can see who submitted a form but not which page they were on, which campaign sent them, or what UTM source drove the visit.
Solution: Include a metadata object alongside your payload — it stores source context without mixing it into the form data itself.
Example
await enterestos.trackResponse({
type: 'demo_request',
payload: {
name: 'Marcus',
email: '[email protected]'
},
metadata: {
pageUrl: window.location.pathname,
referrer: document.referrer,
source: 'pricing_page',
utmSource: new URLSearchParams(window.location.search).get('utm_source'),
utmCampaign: new URLSearchParams(window.location.search).get('utm_campaign')
}
});Common Metadata Fields
| Field | Description | Example |
|---|---|---|
| pageUrl | URL where the form was submitted | /pricing |
| referrer | Previous page URL | https://google.com |
| source | Human-readable source label | pricing_page |
| utmSource | UTM source parameter | |
| utmCampaign | UTM campaign parameter | q2_launch |
Metadata is optional. You can omit it entirely or pass an empty object — both are valid.
Result: You now know how to attach source context to every submission — so when you follow up, you know exactly where that person came from.
Common Questions
What is the difference between payload and metadata in EnterestOS?
Payload is what the person submitted — name, email, message. Metadata is context about the submission — which page they were on, what campaign sent them, what referrer brought them. Both are stored on the response.