Google Analytic URL based goal not catching everything - regex

I have a simple destination based goal triggered by regex match (confirmation page when someone books a trip). Problem is, compared to our crm (on any given day) there is around 20-25% discrepancy.
Here is 3 different types of URL that signaling goal completion :
/owner/reservation-confirmation?bv=true&reservationNo=MG3P3
/owner/reservation-confirmation?bv=true&type=Future&reservationNo=MG4GX
/owner/reservation-confirmation?type=Future&reservationNo=MG225
And Goal destination Regex:
(/owner/reservation-confirmation\?bv=true&type=Future&reservationNo=.* )|(/owner/reservation-confirmation\?type=Future&reservationNo=.* )|(/owner/reservation-confirmation\?bv=true&reservationNo=.* )
For some reason, GA missed creating a completed goal for URL's like:
/owner/reservation-confirmation?type=Future&reservationNo=MG4J0
(URL above is in GA under "site content/all pages)
Goal setup :
Any idea why is this happening?
Thank you!

The space at the end of each group appears to be breaking this. The following (also with correct escape characters for the forward slashes) works fine:
(\/owner\/reservation-confirmation\?bv=true&type=Future&reservationNo=.*)|(\/owner\/reservation-confirmation\?type=Future&reservationNo=.*)|(\/owner\/reservation-confirmation\?bv=true&reservationNo=.*)
regex101.com working example here.

Related

How to use regex to insert dynamic urls in the Analytics conversion funnel?

A have a client who has an ecommerce website working on Wix. She asked me to setup the conversion funnel so she could identify when visitors leave a step, I mean, those who don't get to the order placed page. On Wix, we have 3 steps/urls, as below:
Cart: https://www.easyhomedesign.com.br/cart?appSectionParams=%7B%22origin%22%3A%22cart-popup%22%7D
Checkout: https://www.easyhomedesign.com.br/checkout?appSectionParams=%7B%22a11y%22%3Afalse%2C%22cartId%22%3A%2283476f86-4ac9-44ac-8779-4479dde12cc2%22%2C%22storeUrl%22%3A%22https%3A%2F%2Fwww.easyhomedesign.com.br%2F%22%2C%22isFastFlow%22%3Afalse%2C%22isPickupFlow%22%3Afalse%7D
and the Thank you page: https://www.easyhomedesign.com.br/thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17
After each of those urls, we have dynamic string values, so I need to put into the funnel step, on the url field, those same urls but using a regex that matches to the config "starts with", since we can't know what the values on the end of the urls are and, on the funnel setup section, we don't have that combobox "Starts with". At least, that's the only solution I could think about.
Then, my idea is use something like https://www.easyhomedesign.com.br/thank-you-page/$. I don't know regex, that's only an example of what I thought about, since that part of the url is the fixed one.
Could someone help me? tks.
Although the final goal setup highly depends on your Analyitcs implementation, it is basically possible to cover such funnel with RegEx in goal funnels.
Google Analytics tracks page visits with path, buy default. So https://www.easyhomedesign.com.br/thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17 will become /thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17 in your reports. It can be set up to contain the domain, and the goal flow can be created as well, but it's important to check, how the RegEx should be created.
It is also important, if the above mentioned query parts are affecting the step, whether they are part of the flow or not.
Assuming that the path part is relevant, you can set up something like this.
Cart URL in reports: /cart?appSectionParams=%7B%22origin%22%3A%22cart-popup%22%7D
Cart step RegEx in goal flow: ^\/cart
^ stands for beginning of the string, but you might need to adjust, if host is present in your reports. You can also extend it to ^\/cart\?, if you expect any parameters to be present, to qualify for cart visit.
Checkout URL in reports: /checkout?appSectionParams=%7B%22a11y%22%3Afalse%2C%22cartId%22%3A%2283476f86-4ac9-44ac-8779-4479dde12cc2%22%2C%22storeUrl%22%3A%22https%3A%2F%2Fwww.easyhomedesign.com.br%2F%22%2C%22isFastFlow%22%3Afalse%2C%22isPickupFlow%22%3Afalse%7D
Checkout Cart step RegEx in goal flow: ^\/checkout
The same applies for checkout step for beginning of the string, or for any parameters required.
Thank you URL in reports: /thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17
Thank you RegEx, which is essentially the goal's RegEx: ^\/thank-you-page\/[\w-]+
Here, the [\w-]+ part expects alphanumerical characters, underscore, or hyphen to be present. More precisely, one or more must exist there.
The $ sign, mentioned in the OP, could not be used here, as it indicates the end of the string, and therefore the id at the end of the URL would make it non-matching.

Google Analytics events regular expression grouping

We have set-up JW Player (an off the shelf embedded video player) to send our video play events into Google Analytics as Events (they appear in Behaviours > Events > Top Events > JW Video Plays). We stream from AWS Cloudfront with signed URLs so the URLs for each video play are computed and unique - something like this:
rtmp://streaming.oursite.com/cfx/st/mp4:xtra/tutorial/video/somevideo.mp4?Key-Pair-Id=APKAJPGHQNAH3663VQQQ&Signature=m6HTuv-IRaR5N3zu58w1Rh5mIuhhETPuEVBMBQv9Tb1ZXvsy3lg9dgpp-FtBPwZYWkI5fR0kAuBir6OnAXst3F6FyXve7s5gQSdoJMtCDcGIFtyyw8kZCBaFPa71jr1sDy9L~xf3VDDH0tIksfXZ-z9t~tZg7tnfw~iVLfKDTtE_&Expires=1413316048
So in order to judge popularity we'd like to group the play events by their basic video path, e.g.
rtmp://streaming.oursite.com/cfx/st/mp4:xtra/tutorial/video/somevideo.mp4
I tried using the configurable JWPlayer id_string but that doesn't seem to work, so I am falling back to using regex in Google Analytics, but we can't seem to get the URL grouping to work. We tried this advanced regex filter:
^(.*?)\?.*$
based on https://support.google.com/analytics/answer/1034836?hl=en which says
() remember contents of parenthesis as item
but that has no effect.
Is it even possible, and if so what Regex should we be using please?
I think your problem is the first ? question mark, in (.*?). You've used it in the usual regex way to change greedy to non-greedy, as done in PHP/Java/Perl etc. But there appears to be nothing in the Google Analytics help screens to suggest it can rise to those heights. They only say it means 0 or 1 in their regex system.
So you need an alternative form for your regex. You could try just putting ^(.*)\?.*$ instead, but it probably won't work (however I couldn't see in the documentation whether GA is by default greedy or lazy, so it's worth trying first).
Failing that, then the alternative way to achieve what you want will be to use a character class in square brackets to look for all the possible letters and digits that could occur in your file names:
^([a-zA-Z0-9/:.]*)\?.*$
(check if there are any other characters from your file names that should be in there as well).

Google Analytics Regex to exclude certain parameter

I'm relatively new to regex and in order to set up a goal in Google Analytics, I'd like to use a regular expression to match a URL containing both "thank-you" and "purchaseisFree=False" but exclude two specific rate plans that are represented in the URL as "productRatePlanID=5197e" and "productRatePlanID=c1760".
Here is a full URL example:
https://www.examplepage.com/thank-you?productRatePlanId=5197e&purchaseIsFree=False&grossTotal=99.95&netTotal=99.95&couponCode=&invoiceNumber=INV00000589
I tried using this post as a model and created this regex:
\bthank-you\b.+\purchaseIsFree=False\b(?:$|=[^c1760]|[^5197e])
However, I'm not getting the desired results. Thanks in advance for any suggestions.
I think the below mentioned regex should solve your problem. It uses the positive|negative look ahead facility. We can sit at the beginning of http[s] and check all the three condition and then engulp the whole tree
(https?:\/\/)(?=.*?productRatePlanId=(?!5197e&)(?!c1760&))(?=.*?thank-you)(?=.*?purchaseisFree=False).*
Note:- I have used & after the productRatePlanId values just to ensure it doesnt ignore other values as 5197f, 5198d and all other sorts of values.

Tracking form submissions with Goals/Type=Destination in Google Analytics

I created a goal with a required funnel. My URL's aren't clean, thus I am using REGEX to match.
Funnel step: Site.com/results/?session=43903549035490345 Regex: \/results\/\?session=
Goal step: Site.com/results/bestquotes/?00000#xyz Regex: \/results\/bestquotes\/\?
Problem 1: In the real-time conversions view, the funnel isn't being respected, meaning if I refresh the page the counter is registering another hit.
Problem 2: In Conversions>Goals>Overviews - No information is present on this screen.
screenshot: (just because I need someone to confirm I'm not insane) :)
The Regexs look like they should be working. Still, I think you can try to do this with a Begins with rule instead of a regular expression. It would be much more readable.
Begins with /results/?session=
Begins with /results/bestquotes/?
Have you tried this?

Regex: Match any string but one ending with thanks/

I am attempting to set up a goal funnel in Google Analytics. It is for an online quote request system that we want to track. Basically all the pages that contain the quote request form have unique dynamically generated urls that are similar. The form of the URL is:
/quoterequest/categoryone/categorytwo/productname/
I have regex that works for tracking that:
^/quoterequest/([A-Za-z0-9/-]+)?
Today we added a thank you page after the user submits the form. The URL is always the same for that:
/quoterequest/thanks/
I would like to modify the above regex so that it continues to match any of the Quote Request URLs, but NOT that thank you URL. I have been trying different variations, including t. he negative look ahead,but unfortunately I am not very experienced with regex and I think I've been doing it completely incorrectly. Can anyone give me some insight as to the correct method of doing this?
You can use:
^\/quoterequest\/(?!thanks\/?$)(?:([A-Za-z0-9\-]+)\/?)*$
See it