---
slug: herkunft-im-formular
title: "How does the origin of an enquiry get into my CRM?"
category: installation
locale: en
updated: 2026-10-15
keywords: ["form","hidden fields","CRM","lead","lead ID","UTM","gclid","contact form","Contact Form 7"]
questions: ["Can Metrunio write source, campaign and an identifier into my contact form?","Fill hidden form fields","Pass UTM parameters to the CRM","Store the gclid in a contact form","How do I connect a CRM lead to its journey?","Hidden fields for HubSpot, Pipedrive or Salesforce","Where did this enquiry come from?","Assign a lead ID automatically","Does Metrunio fill the form without consent?","Why are the source fields in my form empty?","Write UTM parameters into forms without cookie consent"]
url: https://bench.metrunio.com/en/help/herkunft-im-formular
---

# How does the origin of an enquiry get into my CRM?

**Can Metrunio write source, campaign and an identifier into my contact form?**

Through your form, on every plan: give it the attribute `data-metrunio-lead`, and with consent to analytics the SDK fills the fields `metrunio_lead_id`, `metrunio_source`, `metrunio_medium`, `metrunio_campaign`, `metrunio_click_id` and `metrunio_click_platform`; without consent they stay empty unless you switch on “Source without consent as well” for the site. With the lead ID, the offline import finds the later deal from your CRM in the journey.

For enquiries, measurement often ends at the form: the deal closes weeks later in the CRM, and by then nobody knows where the enquiry came from. That is why the SDK writes the origin and an identifier into the form itself. They travel with the enquiry into your CRM; with the deal, the identifier comes back through the offline import and connects it to the journey.

## Setting it up

```html
<form action="/enquiry" method="post" data-metrunio-lead>
  <input name="email" type="email" required />
  <button>Send</button>
</form>
```

- The SDK fills the form on load, whenever consent changes, as soon as someone enters a field, and right before it is submitted. It adds missing fields as `<input type="hidden">`; an existing field with the same name is filled.
- If you have a thank-you page, report the enquiry there with `metrunio.conversion({ type: 'lead' })`. Without an identifier of its own, the SDK takes the one from the form.
- Without a thank-you page, write `data-metrunio-lead="submit"`. The SDK then reports the enquiry itself on submit, once per identifier. What counts is the submission, not your server’s response.
- Fill forms that appear later with `metrunio.fillForm(form)`, passing the form or a selector such as `'#enquiry'`.

## The fields

| Field | Content | Needs |
| --- | --- | --- |
| metrunio_lead_id | identifier of the enquiry, such as lead_3f2a…; valid for the session | consent to analytics |
| metrunio_source | utm_source the visit started with | consent to analytics; without it only with “Source without consent as well”, then from this page’s address |
| metrunio_medium | utm_medium, likewise | likewise |
| metrunio_campaign | utm_campaign, likewise | likewise |
| metrunio_click_id | the ad platform’s click ID, such as the gclid | consent to marketing |
| metrunio_click_platform | google, meta, microsoft, tiktok, linkedin or metrunio | consent to analytics |

Source, medium and campaign come from the address the visit started with, not from the page with the form. The SDK does not assign a channel in the browser: your origin rules in Metrunio do that, and your CRM gets the values as they were in the address. The whole journey hangs on the lead ID.

## Consent

- Without consent to analytics, all fields stay empty. The SDK does not even read the page address for them.
- It writes the click ID only with consent to marketing. Under statistics, the platform remains, just as Metrunio itself stores only the source of a click under statistics, not its ID.
- After consent is withdrawn, the SDK empties the fields it filled itself. After `metrunio.reset()`, a new identifier begins.

> **Legal note:** What arrives in your CRM, you process there as the controller. The fields end up there together with the name and email address of the enquiry and thereby become personal data, source, medium and campaign included. The lead ID connects a record in your CRM with a journey in Metrunio; describe this where your privacy policy describes the measurement, and clarify it with your data protection adviser.

## Text for your cookie banner

For consent to analytics to cover this purpose, the description of the category should name it. Adapt it to your data flows and periods: “With your consent to analytics, we link the source and campaign of your visit to your enquiry in our CRM and to a sale reported later, using an enquiry identifier. This lets us see which visits lead to enquiries and sales. We use platform click identifiers for this only where you have also given the corresponding marketing consent.” You do not need an extra checkbox for this.

## Source without consent as well

In “Setup”, each site has the setting “Source without consent as well” under “Source in forms”. It is off. If you switch it on, the SDK writes source, medium and campaign from the current page’s address into the form without consent to analytics, as it did before 12 October 2026. Nothing more: no lead ID, no click ID, no platform, nothing in the browser’s storage. With consent, the setting changes nothing.

- The setting appears in the embed code as `formSourceWithoutConsent: true`. Copy the code again after switching. In the GTM template it is the box “Write the source into forms without consent as well”; in the template file from the portal, which is in German, it reads “Herkunft auch ohne Einwilligung in Formulare schreiben” and is pre-filled with the site’s setting.
- The apps and plugins for Shopify, Shopware and WordPress do not pick up the setting. There, the fields stay empty without consent.
- If you load the SDK yourself, pass the option to `metrunio.init`.

> **Legal note:** You justify the consent-free operation yourself; Metrunio does not make this decision for you. Two processes need to be considered separately: the SDK reads the address in the browser, which is access to the end device (Section 25 TDDDG). And your CRM links the source to a named enquiry. Both need a legal basis, and both belong in your privacy policy. That it is only UTM data is not enough on its own. Before switching it on, record which exception under Section 25(2) TDDDG covers the access and which legal basis under the GDPR covers the matching in your CRM; if you find no sound exception, only this setting stays off, not source in forms as a whole. This note is not legal advice; clarify the setting with your data protection adviser before switching it on.

## Form plugins and embedded forms

- Contact Form 7: add the fields as hidden fields, for example `[hidden metrunio_lead_id]`, and include them in the mail with `[metrunio_lead_id]`. A small script in the page footer sets the attribute: `document.querySelectorAll('.wpcf7-form').forEach((f) => f.setAttribute('data-metrunio-lead', ''));`.
- Many form plugins and form services only store fields they created themselves, and some show the form in an iframe the SDK cannot reach. Add hidden fields with exactly these names there and check with a test enquiry whether the values arrive in your CRM.
- If they do not, assign the identifier yourself: report the enquiry with `metrunio.conversion({ type: 'lead', leadId })` and an identifier your CRM already knows.

## And back

When an enquiry turns into a deal, export it from your CRM with the lead ID in the `lead_id` column and import it as an offline conversion under “Orders & goals”. Metrunio finds the journey for that identifier and recalculates the attribution.

## Also asked

- Fill hidden form fields
- Pass UTM parameters to the CRM
- Store the gclid in a contact form
- How do I connect a CRM lead to its journey?
- Hidden fields for HubSpot, Pipedrive or Salesforce
- Where did this enquiry come from?
- Assign a lead ID automatically
- Does Metrunio fill the form without consent?
- Why are the source fields in my form empty?
- Write UTM parameters into forms without cookie consent

## Related

- https://bench.metrunio.com/en/help/offline-conversions-importieren
- https://bench.metrunio.com/en/help/sdk-api
- https://bench.metrunio.com/en/help/consent-grundsatz
- https://bench.metrunio.com/en/help/wie-entsteht-journey
- https://bench.metrunio.com/en/help/snippet-einbauen
