Lists

URL query string parameters in list and workflow criteria

Last updated: September 11, 2019

Applies to:

Marketing Hub  Professional, Enterprise
Legacy Marketing Hub Basic

Query string parameters are added to your website URLs when you use tracking URLs to track a visit from a certain source and campaign, or pass values in the URL. They're also used in some external CMS systems to display specific content on a page.

UTM query strings vs. non-UTM query strings


HubSpot strips UTM parameters from visited URLs in contact records. Because of this, list and workflows using the Page view filter may not pull in the contacts you're expecting. There are two differences in the way that Page view filters search for contacts:

  • If you use UTM parameters in a Contact has visited URL containing filter, the list or workflow will include the UTM parameters in its search. Because HubSpot strips UTM parameters from visited URLs in contact records, contacts who have visited the page with UTM parameters will not be pulled into the list or workflow.
  • If you use UTM parameters in a Contact has visited exact URL filter, the list or workflow will not include the UTM parameters in its search. Contacts who have visited the page with or without UTM parameters will be pulled into the list or workflow.

Learn more in the examples below.

Common UTM parameters that are stripped from visited URLs in contact records include:

  • source
  • utm_source
  • utm_medium
  • utm_campaign
  • utm_content
  • utm_term

However, HubSpot will not strip non-UTM query strings from visited URLs on contact records. For example, in the URL www.hubspot.com/offer?discount, ?discount is a non-UTM query string. 

Example scenarios

The example scenarios below illustrates how the lists and workflows tools handle query strings when evaluating whether a contact meet its criteria. For purposes of the examples, there are three contacts who viewed the page differently:

  • Contact 1 has viewed the pricing page as a part of an email campaign set up with a tracking URL, http://www.domain.com/pricing?utm_source=email.
  • Contact 2 has viewed the pricing page as a part of a separate campaign, tracked with a different query string, http://www.domain.com/pricing?specialdiscount.
  • Contact 3 has viewed the pricing page by organically navigating through the website and viewed the page without a query string, http://www.domain.com/pricing.

Scenario 1

To add contacts who have viewed the page as a part of your email campaign to a list or workflow, the criteria Contact has visited URL containing, is set to /pricing?utm_source=email

list-1
URL containing

The list or workflow looks for contacts who have visited the URL with that exact query string.

  • Contact 1 will not be added to the list or workflow because ?utm_source=email is stripped from their contact record. The URL they viewed is recorded as http://www.domain.com/pricing. This does not match the criteria as it does not include "/pricing?utm_source=email".
  • Contact 2 will not be added to the list or workflow because they viewed a URL containing /pricing?specialdiscount. This does not match the criteria as it does not include "/pricing?utm_source=email".
  • Contact 3 will not be added to the list or workflow because they viewed a URL containing just /pricing. This does not match the criteria as it does not include "/pricing?utm_source=email".

Scenario 2

To add contacts who viewed the page as part of another campaign to a list or workflow, the criteria Contact has visited URL containing, is set to /pricing?specialdiscount.

list4
  • Contact 1 will not be added to the list or workflow because their viewed page URL recorded is http://www.domain.com/pricing. This does not match the criteria, as it does not contain "/pricing?specialdiscount".
  • Contact 2 will be added to the list or workflow because they viewed a URL containing /pricing?specialdiscount and non-UTM query string parameters are not stripped from the contact record. This matches the criteria, as the recorded URL contains /pricing?specialdiscount.
  • Contact 3 will not be added to the list or workflow because they viewed a URL containing just /pricingThis does not match the criteria, as it does not contain "/pricing?specialdiscount".

Scenario 3

To pull in contacts who have viewed a URL containing /pricing without any query string parameters, the criteria Contact has visited URL containing, is set to /pricing.

list-2

All 3 contacts will be added to the list or workflow. They meet the criteria because they have all viewed the page containing /pricing. In this scenario, it doesn't matter if they viewed the page with or without the query string.

Scenario 4

To add contacts who have visited the exact URL for your email campaign, http://www.domain.com/pricing?utm_source=email, the criteria Contact has visited exact URL is set to the full URL.

list-3

In this case, HubSpot strips the UTM parameters from the criteria URL as well. The list or workflow will hence, look for contacts who have viewed the exact URL http://www.domain.com/pricing, and not the URL containing the query parameters.

  • Contact 1 will be added to the list or workflow because their viewed page URL recorded is http://www.domain.com/pricing. This matches the criteria that the list or workflow is looking for.
  • Contact 2 will not be added to the list or workflow because they viewed the URL with a non-stripped query string attached: http://www.domain.com/pricing?specialdiscount. This doesn't match the criteria, as it is not the exact URL "http://www.domain.com/pricing".
  • Contact 3 will be added to the list or workflow because the exact URL they visited is http://www.domain.com/pricing. This matches the criteria that the list or workflow is looking for.