Metadata

Optional context you can attach to any response.

2 minPrerequisites: Understand payload

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

typescript
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

FieldDescriptionExample
pageUrlURL where the form was submitted/pricing
referrerPrevious page URLhttps://google.com
sourceHuman-readable source labelpricing_page
utmSourceUTM source parametergoogle
utmCampaignUTM campaign parameterq2_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.