Advanced Marketing Techniques in Webflow

Query Param Passthrough

Overview
Referral Tracking
Referral Tracking
201
Query Param Passthrough
202
Content Access Control
Limited-Use Links, to Protect Marketing Content
301
No items found.
Published
February 2, 2024
Updated
February 2, 2024
in lightbox

When tracking referrers, it's common to use UTM parameters or a referrer code in the querystring, so that you can identify the origin of the click.

But what happens when you want to allow the user to navigate the site, and then capture that information later when they submit a form?

One approach here is known as query param passthrough, where you take the query parameters from the landing page, and carry them through to every other page on your site.

Approaches

Append-Everything

Here's a very simple version of this approach, which you'd place in your site-wide before-body custom code area.

This approach takes the current page querystring and appends it to any local links in your page- so that when you click them those parameters are preserved.

This works because Webflow generally doesn't use querystring parameters, and because most browsers are pretty forgiving about an invalid querystring with multiple ?'s.

However there are a few places this is likely to create confusion;

  • Pagination, e.g. going from a page 2 to a page 3.
  • Possibly user account redirects
  • Possibly some aspects of e-commerce

More Elegant Approaches

A more elegant approach is to;

  • Detect the query params
  • Capture and save that content in webStorage
  • Hide them from the URL
  • Access that data later when you need it for form submissions and API requests

That’s somewhat more complex to build, and you have to carefully check any cookie-consent setups, but it’s much prettier.

Notes

https://discourse.webflow.com/t/utm-parameters-are-not-passed-for-blog-articles-links/269517

Videos
No items found.
Table of Contents
Comments
Did we just make your life better?
Passion drives our long hours and late nights supporting the Webflow community. Click the button to show your love.