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.

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

Here is the variable that comes with the Elevar container:

By default this is set to q which is the default query parameter with Shopify.

To test your own store then perform a site search and look at the URL in your browser to confirm:

In this example my search performed was "shirts" and I can see in the URL that q=shirts is my search query parameter.

So q is the query parameter used in the variable screenshot shown above.