Sign in
← Attribution docs
Install guide

Other platforms

MTK Attribution works on any site that renders a real form in the page. The method is always the same two ideas: load the tag, then point a few hidden fields at your attribution data — either by naming the field, or by dropping a [mtk:…] token into its default value.

1

Load the tag on every page

Paste the loader into the site's <head>on every page — every platform has a "custom code", "code injection" or "header scripts" setting for exactly this.

<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.

Put it in the <head> directly, not in Google Tag Manager. When GTM is blocked — an ad blocker, a privacy browser, a consent banner the visitor never accepts — nothing inside the container fires, and a tag that lives in GTM never loads. That lead arrives with empty attribution fields. Loaded straight from the <head>, the tag runs whether or not GTM does. A GTM Custom HTML tag on all pages still works if the <head> is genuinely off-limits, but treat it as the fallback, and expect to lose the leads whose browser blocks the container.

2

Add hidden fields — pick whichever your platform allows

Two interchangeable ways to populate a field:

  • By name — if the platform lets you set a field's name attribute, name it the HTML Name from your field map (e.g. mtk_first_source). The tag fills it and pushes it to the dataLayer under that name.
  • By token— if you can't control the name (most hosted builders), paste the [mtk:…]token into the field's default value. The tag replaces it on load and at submit.
3

Publish and verify

Publish, then land on the page with a test URL like ?utm_source=googleads&utm_medium=cpc, submit the form, and confirm the values arrive where the platform stores submissions.

Notes for specific platforms

HubSpot Forms
In the form editor add a Hidden field and set its default value to the [mtk:…] token. Use the inline (non-iframe) embed so the tag can reach the fields.
Shopify
Add the tag inside the <head> of theme.liquid. On contact / newsletter forms, add a hidden input named to the field-map key, or drop the token into a hidden field's value.
Contact Form 7 / WPForms
WPForms: add a Hidden field and put the [mtk:…] token in its Default Value. Contact Form 7 pastes hidden inputs straight into the form template, with a wrinkle worth reading first — see the dedicated Contact Form 7 guide. Load the tag into the <head> with a headers plugin either way.
Typeform & embedded iframes
Forms inside a cross-origin iframecan't be read from the parent page. For a form domain you control, install the tag on both sites and the frame adopts the parent page's journey — see Forms in a cross-domain iframe. For a hosted builder that won't run the tag (Typeform), use a native/inline embed instead.
React (Formik)
A form whose state lives in React: read the resolved values in the submit handler and send them with the lead, or render hidden fields named to the field map — the tag writes through React's native setter. See the dedicated Formik guide.
Plain / Custom HTML
Add a hidden input and set its name to the field-map key (e.g. <input type="hidden" name="mtk_first_source">), or put the token in its value. For JS-built forms that post their own payload, see the dedicated Custom HTML guide.
Rule of thumb: if the form renders as real fields in the page (not a cross-origin iframe) and you can add a hidden field, the tag can populate it. Tokens and names both come from Dashboard → license → Tag config → Field map. Stuck? Troubleshooting.