Query parameters in URLs (like ?utm_source=google or ?source=facebook) contain valuable data about how visitors arrive at your site. RightMessage lets you capture this data and use it to enrich contacts in your email platform or CRM.

There are two ways to capture query parameters:

Method 1: Hidden fields in forms

Add a hidden field to any RightMessage form to capture query parameters when someone submits the form.

Setting up hidden fields

  1. In the Flow Builder, add or edit an Offer node that contains a form

  2. In the form editor, click "Add Field"

  3. Select "Hidden" as the field type

  4. Set the label (for your reference, like "UTM Source")

  5. In the value field, enter {{ query.current.PARAMETER_NAME }}

  6. Map the field to a custom field in your email platform

  7. Republish your configuration

Replace PARAMETER_NAME with the actual parameter name from your URL. For example, to capture ?utm_source=google, use {{ query.current.utm_source }}.

When someone submits the form with ?utm_source=google in their URL, the value "google" will be captured and synced to their contact record.

Using fallback values

You can set a default value if the query parameter isn't present:

{{ query.current.source | default: 'direct' }}

If ?source= isn't in the URL, the field will capture "direct" instead.

Method 2: System Flows

System Flows run automatically on every page view without requiring a widget. They're ideal for capturing query parameters in the background and updating contacts based on traffic source, campaign data, or other URL parameters.

Creating a System Flow

  1. Go to Flows and click "New"

  2. Click the "Settings" tab

  3. Enable the "System Flow" toggle (this makes the flow run automatically on page views without displaying any UI elements)

  4. Go to the "Build" tab to configure your flow

System Flows cannot include UI elements like questions or offers. If you add these, you'll see an error when trying to enable the System Flow toggle.

Checking for query parameters

Use a Yes/No node to check if a specific query parameter is present:

  1. Add a Yes/No node to your System Flow

  2. Set the condition to "Query Parameter > Custom" or use one of our UTM options

  3. Enter the parameter name (e.g., "source")

  4. Choose an operator (e.g., "equals" for equality, or "is set" for whenever this parameter is present)

Now you can take different actions based on whether the parameter is present and/or matches your condition.

Updating custom fields and tags

In the "Yes" branch of your condition, add a Data node to update the contact:

  1. Add a Data node

  2. Click "Add Action"

  3. Choose "Update Custom Field" or "Add Tag"

  4. For custom fields, enter the field name and set the value to {{ query.current.PARAMETER_NAME }}

  5. For tags, enter the tag name (e.g., "Facebook Visitor")

To store the exact value of a query parameter, use the same format as hidden fields: {{ query.current.PARAMETER_NAME }}

Example System Flow

Here's a complete example that captures traffic source from a ?source= parameter:

  1. Yes/No node: Check if "query parameter source equals facebook"

  2. Yes branch: Data node with two actions:

    • Update custom field "Traffic Source" to {{ query.current.source }}

    • Add tag "Social Lead"

  3. No branch: Data node to set "Traffic Source" to "Direct Traffic"

Save and publish the flow. It will automatically activate and run on every page view.

Query parameter syntax

The format for accessing query parameters is always:

{{ query.current.PARAMETER_NAME }}

Common examples:

  • {{ query.current.utm_source }} for ?utm_source=google

  • {{ query.current.utm_campaign }} for ?utm_campaign=summer_sale

  • {{ query.current.source }} for ?source=facebook

  • {{ query.current.email }} for [email protected]

Parameter names are case-sensitive. Make sure your liquid syntax exactly matches the parameter name in your URL.

Important limitations

URL encoding for special characters

If query parameters contain special characters (like the + symbol in email addresses), they may fail to match conditions. Use the url_encode filter or create separate conditions for path versus query matching.

Single-page capture only

Query parameters are only captured from the current page URL when the flow is triggered. They don't persist across sessions unless you explicitly store them in custom fields or RightMessage variables.

Multiple parameters with the same name

If a URL contains multiple parameters with the same name, RightMessage will capture only the first value.

Testing your setup

To verify query parameters are being captured correctly:

  1. For forms: Preview the flow and manually add the query parameter to your preview URL (e.g., append ?utm_source=test), then submit the form and check the contact's profile

  2. For System Flows: Visit your site with the query parameter in the URL while identified as a known visitor, then check the contact record to confirm the custom field was updated or tag was added

Was this helpful?