Capture Query String Parameters with Form CTAs


If you use query string parameters when sharing links to your Hub, here's how to make sure they're captured and passed to the right fields in your Marketing Automation Platform when a lead submits a Form CTA.


Before You Begin

  • To capture and pass query string parameters on Form CTAs, you need to be an Account Admin or Content Manager.
  • You will also need an account with the Marketing Automation Platform you want to use.


About Query String Parameters and Form CTAs

If you use query string parameters in links to your Hub content, you can set up your Form CTAs to capture these parameters and send them to your Marketing Automation Platform (MAP), like Marketo, HubSpot, etc. This is very helpful for tracking users who came to your Hub from a specific campaign, social media platform, etc.

Here's how it works: once you've chosen the general query string parameters based on the kind of information you want to track, you have to...

  1. Identify the field names in your MAP so that you can name your query string parameters correctly, and...
  2. Add hidden fields to your Form CTAs that are set up to capture the query string parameters you chose.

With that in place, you can build query strings and share the resulting URLs. Any visitor who enters your Hub using one of these URLs and submits a Form CTA will have their query string automatically sent to your MAP.


Step 1: Identify Field Names

Once you have decided what sort of information you want to track with query string parameters (e.g. campaign, referrer, geography, etc.), you will need to figure out where this information lives in your MAP. This will allow you to name the parameter in the query string correctly, so that the parameter's value is eventually filled into the appropriate field in the MAP.

For example, let's say that we want to send a link to a Hub to prospects in particular countries, and we want to be able to record how many prospects from each country submitted a Form CTA. To do that, we need a query string that identifies the country. The query string will be in the format ?parametername=countryname.

In order to choose the right parameter name, we need to find the field in our MAP that records country names. This might be something like location or country or something else entirely. More specifically, we will need the unique name that references the field we want. In HubSpot, for example, this kind of name is called an "internal name". In this particular case, the internal name we need is country:


Now that we know the correct parameter name, we can use it to form our query string, like this: ?country=canada. Then we just add this query string to the end of the link, and it's ready to be shared:

See below for where to find unique field names in the MAP you use (and what they're called). Also, keep in mind that these unique field names are typically case sensitive, so make sure to use them exactly as they appear.

HubSpot Marketo Oracle Eloqua Pardot

In HubSpot, you're looking for the internal name of a property. To find the internal name for a property, follow these instructions:

  1. Log in to HubSpot.
  2. In the top right corner, click on the Gear icon:
  3. This will open the Settings menu. In the sidebar on the left, click on Properties.
  4. In the list of properties, find the property you want to write the query string parameter value to and click on its name to see more details.
  5. Here, look for Internal name:
  6. Use the internal name as the parameter name in your query string, exactly as it appears, e.g. ?country=


Step 2: Configure Hidden Fields on Form CTAs

To make your Form CTAs capture query string parameters and pass them to your MAP, you need to add hidden fields to them. A hidden field is just that: a field that is not visible to the users who interact with the CTA, and which invisibly passes certain details each time the CTA is submitted.

In this case, you need to configure hidden fields to look for specific query string parameters and grab their values. For example, you could set up a hidden field to look for the parameter country: if a visitor enters your Hub with a URL with the query string ?country=canada and then submits that Form CTA, the value canada would be passed to the country field in your MAP.

You can find instructions on how to add hidden fields to your Form CTAs in this article (see the section Set Up a Hidden Field with a Query String Value; click here to go there directly). When filling in the Param field, use the parameter name that you used in the query string (e.g. country for ?country=canada), which you got from your MAP in Step 1.

When you've added the necessary hidden fields to your Form CTAs, you're all set! One last note: remember that you have to configure hidden fields for every CTA separately — query string parameters will only be passed to your MAP by a Form CTA that contains the appropriate hidden fields. 

0 out of 0 found this helpful



Please sign in to leave a comment.