How To Find Query Parameter for Site Search Variable

This shows how to find the query parameter used in our search results variable as part of the data layer.

Overview

If your search term data layer variable is returning undefined then verify the query parameter setup matches what is used on your website.

Example Container:

  • By default the query parameter is set to "q" which is the default query parameter with Shopify.
    • (See Figure 1)

Step 1 screenshot

_Figure 1_

Test Your Shopify Store:

  • To test your own store then perform a site search and look at the URL in your browser to confirm.
    • In this example the search performed was "shirts" and you can see in the URL that "q=shirts". So "q" is the query parameter used in the variable.
      • (See Figure 2)

Step 2 screenshot

Figure 2