Form Setup

Set up SourceTag with Shopify Forms

Shopify contact forms are built with Liquid templates. You add hidden inputs by editing the theme code directly.

What you need

  • SourceTag installed on your Shopify site (script in theme.liquid)
  • Access to your Shopify theme editor

Step 1: Open the theme code editor

Go to Online Store > Themes > Actions > Edit Code.

[IMAGE: Screenshot of Shopify theme editor]

Step 2: Find the contact form template

Look in the templates or sections folder for a file that contains the contact form. Common locations include sections/contact-form.liquid or templates/page.contact.liquid.

[IMAGE: Screenshot of Shopify code editor showing contact form template]

Step 3: Add hidden inputs

Inside the contact form, add hidden input elements before the submit button:

Core hidden fields:

<input type="hidden" name="contact[st_fc_channel]">
<input type="hidden" name="contact[st_fc_detail_1]">
<input type="hidden" name="contact[st_fc_detail_2]">
<input type="hidden" name="contact[st_fc_detail_3]">
<input type="hidden" name="contact[st_fc_detail_4]">
<input type="hidden" name="contact[st_lc_channel]">
<input type="hidden" name="contact[st_lc_detail_1]">
<input type="hidden" name="contact[st_lc_detail_2]">
<input type="hidden" name="contact[st_lc_detail_3]">
<input type="hidden" name="contact[st_lc_detail_4]">
<input type="hidden" name="contact[st_fc_landing_page]">
<input type="hidden" name="contact[st_lc_landing_page]">

Note: Shopify contact forms use the contact[field_name] format. The data appears in notification emails under these field names.

[IMAGE: Screenshot of Liquid template with hidden fields added]

Step 4: Save and test

Save the theme file. Visit your contact page with UTM parameters:

?utm_source=test&utm_medium=cpc&utm_campaign=shopify-test

Submit the form. Check the notification email from Shopify for the attribution data.

Tips

  • Shopify contact form notifications include all submitted fields, including hidden ones.
  • If you use a third-party form app (PageFly, etc.), follow that app’s hidden field instructions instead.
  • Make sure the SourceTag script loads in theme.liquid before the closing head tag.