GA & GDS – Regex for Shopify

This is a list of my own helpful Regex strings for Google Analytics & Data Studio. Some examples are specific to Shopify & and some are more generic.

The intended use case is as a RegExp Match filter in GA or similar in GDS.

Limit to product URL’s / paths that exist under a collections URL:


This will only show you URL’s like this:

Screenshot from Google Analytics showing only Shopify product page paths in collection

In my example above, I wanted to see if a change I made to Shopify theme (to remove these URLs) actually dropped pageviews and landing page hits to those pages. Why I removed them is a separate discussion 🙂

Remove URL parameters (GDS):

I often use this as custom metric within GDS. It’s really a hacky workaround to bring some clarity to dirty GA data to see top pages. I use it to remove weird UTM params like fbclid’s, custom params, yotpo parameters, recommended product referral parameters etc.

REGEXP_REPLACE(Landing Page, '\\?.+', '')
This is a GDS screenshot where I’ve setup a Custom Metric.

Essentially the regex matches part of a string from ? char to anything. So anything question mark and following will be selected, and replaced with ” which is null string, so deleted. So in effect deleting URL parameters. As long as the other metric aggregation is working correctly within GDS they should aggregate okay-ish in GDS, but there are some gotchas, like I with like Ecom Transaction Conversion %’s adding by default which is not correct.

See home page only in Google Analytics

Seems like it should be simple, to filter to home page only but adding a simple text filter contains=’/’ to GA will show you all pages not just the home page.

URL parameters from uncleaned GA data can complicate this. Especially if you want to use logic like; match these:


But not these:


So I’ll use a RegExp like this in GA to filter to home page only:


List of interesting Tech SEO links

I made this list purely out of interest because there is some great Technical SEO content out there that is under-rated and I wanted to do more justice than a bookmark 🙂

A perspective on .htaccess based redirect performance implications and why you should maybe not use .htaccess for redirects:

An interesting case-study on the impact on how JS-heavy content can affect crawl-rate and using SSR to fix:

Some nice ideas around Edge SEO use-cases:

MERJ technical SEO roundups are consistently great- eg:

This alternative approach to dynamic XML sitemap structure to improve crawl rates.

How to write for People Also Ask (PAA)

snip from a Google SERP on “types of rice” showing the People also ask feature

This is a quick summary for my own reference around how to write.


  • Write complete questions and answers. Make sure that each question is asked and answered fully.
  • Use plain language.
  • Avoid sales language.
  • Add Q&A schema.

Answer the question

  • Be concise, and answer upfront
    • You usually only have ~3 sentences to fit an answer into (look at how many words/chars are in some example answers).
    • Make the first half of the first sentence the answer, then elaborate.
  • Meet the search intent
    • Yes/No question, answer Yes/No. If there is more complexity, then elaborate. “Yes, but” is better than no answer at all.
    • numerical question – give a numerical answer
    • time/date question – give a time/date answer
    • price based question – give a $xxx answer or a range, or a from $x

© 2020 Kieran Reid

Theme by Kieran ReidUp ↑