Sign in
Attribution docs
Install guide

Contact Form 7

Contact Form 7 hands you the form template as raw markup, so hidden inputs with [mtk:…] tokens drop straight in — no field builder to fight. The one thing that trips people up is WordPress reformatting what you paste, which is why the block below arrives pre-wrapped.

1

Load the tag on every page

Add the loader as a Custom HTMLtag in Google Tag Manager firing on all pages, or drop it into your theme's <head> with a headers plugin.

<script src="https://attr.boggsmtk.com/v1/tag.js?k=YOUR_LICENSE_KEY"></script>

Swap YOUR_LICENSE_KEYfor the client's key from the dashboard. CF7 renders its form inline in the page — no iframe — so the tag can reach the fields directly.

2

Paste the hidden inputs into the form template

Open Contact → Contact Forms → your form → Formtab, and paste this block in above the submit button. Each input's value holds a [mtk:…] token, which the tag replaces on page load and again at submit; the name is yours, so submissions read First Channel rather than mtk_first_channel. This is the complete default field map — keep the rows you want and delete the rest.

<div style="display:none" aria-hidden="true">
<!-- The [mtk:…] token in value= is what the tag fills — the name is
     yours, so submissions read nicely. Keep the rows you want. -->

<!-- Query sources -->
<input type="hidden" name="First Ad Placement" value="[mtk:first.ad_placement]" />
<input type="hidden" name="Last Ad Placement" value="[mtk:last.ad_placement]" />
<input type="hidden" name="First Campaign" value="[mtk:first.campaign]" />
<input type="hidden" name="Last Campaign" value="[mtk:last.campaign]" />
<input type="hidden" name="First Channel" value="[mtk:first.channel]" />
<input type="hidden" name="Last Channel" value="[mtk:last.channel]" />
<input type="hidden" name="First Content" value="[mtk:first.content]" />
<input type="hidden" name="Last Content" value="[mtk:last.content]" />
<input type="hidden" name="First Landing Page" value="[mtk:first.landing_page]" />
<input type="hidden" name="Last Landing Page" value="[mtk:last.landing_page]" />
<input type="hidden" name="First Landing Page Group" value="[mtk:first.landing_page_group]" />
<input type="hidden" name="Last Landing Page Group" value="[mtk:last.landing_page_group]" />
<input type="hidden" name="First Medium" value="[mtk:first.medium]" />
<input type="hidden" name="Last Medium" value="[mtk:last.medium]" />
<input type="hidden" name="First Query" value="[mtk:first.query]" />
<input type="hidden" name="Last Query" value="[mtk:last.query]" />
<input type="hidden" name="First Referrer" value="[mtk:first.referrer]" />
<input type="hidden" name="Last Referrer" value="[mtk:last.referrer]" />
<input type="hidden" name="First Source" value="[mtk:first.source]" />
<input type="hidden" name="Last Source" value="[mtk:last.source]" />
<input type="hidden" name="First Term" value="[mtk:first.term]" />
<input type="hidden" name="Last Term" value="[mtk:last.term]" />

<!-- Cookies & Click IDs -->
<input type="hidden" name="gclid" value="[mtk:last_paid.gclid]" />
<input type="hidden" name="gbraid" value="[mtk:last_paid.gbraid]" />
<input type="hidden" name="wbraid" value="[mtk:last_paid.wbraid]" />
<input type="hidden" name="msclkid" value="[mtk:last_paid.msclkid]" />
<input type="hidden" name="fbclid" value="[mtk:param:fbclid]" />
<input type="hidden" name="fbc" value="[mtk:cookie:_fbc]" />
<input type="hidden" name="fbp" value="[mtk:cookie:_fbp]" />

<!-- Insights -->
<input type="hidden" name="Journey String" value="[mtk:journey.string]" />
<input type="hidden" name="Journey JSON" value="[mtk:journey.json]" />
<input type="hidden" name="Session Count" value="[mtk:session.count]" />
<input type="hidden" name="Pageview Count" value="[mtk:pageview.count]" />
<input type="hidden" name="Paid Touch Count" value="[mtk:paid_touch_count]" />
<input type="hidden" name="Last Paid Touch" value="[mtk:last.paid_touch]" />
<input type="hidden" name="Time Since Last Paid Touch" value="[mtk:time_since_last_paid_touch]" />
<input type="hidden" name="Page Path" value="[mtk:page.path]" />
<input type="hidden" name="Page URL" value="[mtk:page.url]" />
<input type="hidden" name="Time To Conversion" value="[mtk:time_to_conversion]" />
<input type="hidden" name="Conversion Unix" value="[mtk:conversion_unix]" />
<input type="hidden" name="Conversion Datetime" value="[mtk:conversion_datetime]" />
<input type="hidden" name="Custom Conversion Time" value="[mtk:custom_conversion_time]" />
<input type="hidden" name="Tracking Health" value="[mtk:detect:tracking_health]" />
<input type="hidden" name="Attribution Summary" value="[mtk:attribution_summary]" />
</div>

Paste it as one block, <div> included. WordPress runs the form template through wpautop, which turns every newline between the inputs into a <br> and every blank-line group into a <p>. The inputs draw nothing, but that injected whitespace opens a gap the height of the whole block — the large blank space people hit after adding these by hand. Inside the display:none wrapper the injected breaks collapse to nothing too. Filling is unaffected: the tag matches on the token in value, not on whether a field is visible.

Don't reach for the wpcf7_autop_or_not filter to fix the spacing. It switches wpautopoff for the whole form, and the paragraph tags it generates are usually what the theme's form layout is built on.

3

Check the values reach where you read submissions

CF7 keeps every posted field whose name doesn't start with an underscore, not just the ones declared as CF7 form-tags. So the inputs above ride along on the submission, and Flamingo— CF7's submission-storage companion — records them under those readable names. Same for anything reading the raw POST: a CRM endpoint, a webhook, a Zapier or Make catch hook.

The notification email is the exception. CF7 mail-tags have to start with a letter or underscore and may contain only letters, digits, _, -, . and :no spaces. There is no valid mail-tag for a field named First Channel. If you want attribution in the email itself, register those fields as CF7 hidden form-tags instead, named with the field map's HTML Name:

[hidden mtk_first_channel]
[hidden mtk_last_channel]
[hidden mtk_first_source]
[hidden mtk_last_source]
[hidden mtk_first_campaign]
[hidden mtk_last_campaign]
[hidden mtk_conversion_datetime]

No token needed here — the tag also fills any field whose name matches the field map. Because these are real CF7 form-tags, the Mail tab can reference them:

First channel: [mtk_first_channel]
Last channel: [mtk_last_channel]
First source: [mtk_first_source]
Last source: [mtk_last_source]
First campaign: [mtk_first_campaign]
Last campaign: [mtk_last_campaign]
Submitted: [mtk_conversion_datetime]

Mixing both styles in one form is fine: the readable block for everything you read out of Flamingo or your CRM, plus a handful of [hidden] tags for the few values you want in the email. One trade-off worth knowing — if the tag never loads (ad blocker, script error), a token field submits its raw [mtk:…] text, whereas an mtk_*-named field simply submits empty.

4

Save and verify

Save the form, then load the page with a test URL like ?utm_source=googleads&utm_medium=cpc and submit. Confirm the page has no new gap where the block went, then check the values landed — Flamingo → Inbound Messages, the notification email, or wherever your CRM stores the lead.

Where the names come from:Dashboard → the client's license → Tag config → Field map. The Tokencolumn is what goes in each hidden input's value; the HTML Name column is what to name a [hidden] form-tag (copy button per cell). Building the markup yourself outside WordPress? See the Custom HTML guide. Stuck? Troubleshooting.