Regular Expression Question
-
We are having a little trouble coming up with a goal that shows how many product pageviews we are getting but I need to exclude search results pageviews that (unfortunately) have the same URL structure. Because it's an outside CMS, we have not ability to change the URL architecture.
Products are on these types of pages:
- https://porscheasheville.com/inventory/Porsche+Boxster+Asheville+North+Carolina+2016+Rhodium+Silver+Metallic+536911
- https://porscheasheville.com/inventory/Audi+A4+2.0T+Premium+Plus+Asheville+North+Carolina+2015+Gray+638379
Search results pages have this URL structure:
- https://porscheasheville.com/inventory/new/
- https://porscheasheville.com/inventory/?condition=new&make=Porsche&model=Boxster
- https://porscheasheville.com/inventory/used/
- https://porscheasheville.com/inventory/?condition=used&model=A4+2.0T+Premium+Plus
I am hoping to create a GA goal with regular expressions showing only the product pages and not allowing the search results pages show up.
Here's what I have, it's not working - any regex experts out there who can help? /inventory/[new/][used/]
Thanks as always MOZ friends!
-
This worked out perfectly, thank you so much for the help!
Cheers!
-
Hey ReunionMarketing,
Using the examples you provided, the following Regex should work for you.
/inventory/[^(new|used|?condition)]
Effectively this is saying:
Look for /inventory/ where the next character grouping isn't new, used, or ?condition.
I tested this on all of your examples and it should work perfectly for you.note: this will include /inventory/ as a goal, so make sure that's not an issue for you.
I recommend using regex101.com for any further regex that you need to build as I think it's a great tool.
Let me know if you run into any further issues on this and I'll help you out!
Regards,
Trenton
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Question on structuring URLs in a Drupal CMS - Adverse SEO or Analytics impacts?
Hello Moz Community, We're building out a health system (think a bunch of hospitals and clinics etc.) website on Drupal for the first time. Nebraskamed.com is our domain. Because we're using nodes instead of pages, our URL structure can pretty much be whatever we think makes sense. Our proposal is to drop /blog/ and related terms from the URL structure, because it doesn't really mean anything to the user. Instead, we'd use the service line "cancer" for example, followed by the name of the blog post or document. Example: nebraskamed.com/cancer/10-bone-cancer-myths Do you see any red flags (perhaps with SEO or Analytics for example) to what I'm proposing? domain name/service line/blog-post-name If so, do you have a URL structure you advise?
Reporting & Analytics | | Patrick_at_Nebraska_Medicine1 -
Question re Google Analytics and its more accurate alternatives
Hi guys There are two main issues we have with Google Analytics, and I'd really appreciate if anyone has the time to give an answer to that. We completely miss organic traffic data before 7/22/2013 although our account is active since 2005. Any thoughts on that? Is it the not provided move that swiped out all data or something else? Even for the data we do have there is lots of inaccuracies, and we are thinking on switching or at least adding a new analytics software, any recommendations? (FYI, it turns out we do not keep access logs on the server for more than 2 months, and we might fix that for future references, but now we are looking for external solution). Any help will be much appreciated Thanks Lily
Reporting & Analytics | | wspwsp0 -
Weird Google Analytics tracking question
I have a client that has a market place site, where people list goods and sell them, think something like Etsy. Instead of developing a system to show the users page views and things like that, does it sound reasonable to let them enter a Google Analytics property on the pages they list on, then let them monitor through GA? Does anyone see any fatal flaws in this thinking?
Reporting & Analytics | | LesleyPaone0 -
URL String Tracking Question--Need help!
I am doing some research for a freelance project and found a URL receiving a decent amount of traffic from search with this url string after the normal page url (xxx.com/credit-card-counseling.aspx?match=e&query=debthelper.com&id=22097628847&id=1810807655) Is this some sort of GA tracking code? Why would it be used on that page to track organic search hits if that happens automatically? Would love some help figuring this out! Thanks,
Reporting & Analytics | | RickyShockley0 -
404 errors more than 1.8 lacs, Duplicate Content, Duplicate title, missing meta description increasing as site is based on regular ticket selling (CRM), kindly help
Sites error increasing i.e. 404 errors more than 1.8 lacs, Duplicate Content, Duplicate title, missing meta description increasing day by day as site is based on regular ticket selling (CRM), We have checked with webmasters for 404's, but it is not easy to delete 1.8 lac entries. How to resolve this issue for future. kindly help and suggest the solution.
Reporting & Analytics | | 1akal0 -
Google Analytics - Referral Traffic Question
How Google Analytics determine that some particular web site referred traffic if there is no back link on that site?
Reporting & Analytics | | DiamondJewelryEmpire1 -
Question for SEO experts!
I am checking my competition with all the metrics available and I have no clue why we are not coming up higher in ranking on Google. It's been 3 months and we've been bouncing between 9 and 7 position. One competitor just came out of nowhere with almost 600 internal links and few external links and occupied 3rd spot. I've built pretty good portfolio of links with links even coming from Google for crying out loud. My on page optimization is very good, we've even passed W3C with no errors. At least 3 of our competitors above us have less Domain Authority, Page Authority, Back links for external domains, number of external domains, etc... Not sure what is going on. We are not really trying to be the top dog in Google all the time, but it is the principle of a thing. Keyword is Laser Marking. Our domain starts with cms. Don't want to type the whole URL because Google might crawl (maybe a bit of paranoid at this point LOL) Any suggestions?
Reporting & Analytics | | DmitryP0 -
Reg Ex Question about Rewrite Rules
In this redirect rule, what does the "$1" mean? RewriteCond %{HTTP_HOST} ^(oldsiteaustin|www.oldsiteaustin) [NC] RewriteRule ^(.*)$ http://austin.newsite.com/$1 [R=301,L]
Reporting & Analytics | | SEOteamfl0