0
votes

I have an extremely weird filter issue with Google Analytics and Shopify. It used to control spam referral issues and control page views for just the store.

A view is setup that includes only the store's subdomain and its checkout based on the hostname filter field. I have tried these filter patterns:

store\.domain\.com|.*shopify\.com
store\.domain\.com|checkout\.shopify\.com
^(store\.domain\.com|checkout\.shopify\.com)$

The only pages included have a hostname of store.domain.com. No pages on shopify.com ever get included. It's only when the filter is removed altogether that page views on the shopify.com start appearing.

Here's where it gets weirder.

I have an unfiltered view setup where I run the exact filter patterns on the hostname as an advanced segment. Pages on the sub-domain checkout.shopify.com show for any of the filter patterns.

Secondly, I confirm the pages disappearing in the analytics reports have a hostname that is exactly:

checkout.shopify.com

Any further debugging ideas? Possible explanations?

1
Are you sure you can add custom Analytics pieces of code within checkout.shopify.com? That's a url where Shopify holds most of the control due of being a PCI compliant url. - alexandresaiz
No control. But control or not, nothing to my knowledge could lead to these issues. - Joshua

1 Answers

2
votes

The reason why your filter isn't working is because the Checkout at Shopify uses virtual pageviews instead of the regular ones, in order to have neat names that make your reports and funnels clean instead of leaving a bunch of meaningless IDs like the ones you see in the URL. These pageviews don't contain a hostname.

Now you may be wondering why it worked in your advanced segments. If you check your Hostname report (under Audience > Technology > Network) you'll see the checkout.shopify.com hostname there, but with 0 sessions and some transactions. That's because it was the ecommerce tracking code that sent the hostname value that you saw in your segment, not the pageview.

One solution in this case is to create your filter in two steps.

1) Merge the Hostname and Request URI into Custom Field 1 with an Advanced filter. If Hostname is your Field A, make sure you leave "Field A Required" unchecked.

2) Filter the custom field for store.domain.com|/checkout

On a side note, my preferred method to avoid spam in to simply create a new property. You'd be surprised how most spammers only target UA-XXXXX-1 and leave alone all others properties. They are probably just using the Measurement Protocol to send fake data and they generate the IDs programatically instead of actually going through the trouble of finding the code on the site.

I hope that helps, and don't hesitate to contact me or Shopify's support if you need any extra help.