Pro Tip >> Here is how to become a #regex (regular expressions) power user overnight...

Regular expressions (also called regex) are used to check for a pattern in a string.

For example ^Colou?r$ is a regular expression that matches both the string: 'color' and 'colour'.
Regex comes in many flavours based on the type of syntax being used. These flavours are called the regex engine.

The most popular regex engines are PCRE (PHP), JavaScript, Python and Golang.
Different regex engines support different types of syntax, and the meaning of metacharacters may change depending on the regex engine being used.

Thus, a regular expression considered valid under one regex engine may not be considered valid under another.
Since the regex engine used by #GA4 and GTM is 'JavaScript', you should always use 'JavaScript' as the regex engine before testing your regular expressions for GA/GTM.
Regex is commonly used to set up complex triggers in GTM, create a regex table and custom JavaScript variables, exclude traffic from an IP address range via filters etc.

However, the biggest problem is creating the correct regex.

Here ChatGPT (an AI-enabled chatbot) can help.
You can ask ChatGPT to create a JavaScript regex that matches your specified pattern.

Then test the regex supplied by ChatGPT via a tool like regex101 .com/. It's likely to work.

You no longer need a PHD in regex to use it.
**If you like this post, share it with others and follow me."**

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Himanshu Sharma

Himanshu Sharma Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @analyticsnerd

Dec 28
To learn #GA4 better than most, compare it with GA3 (universal analytics).

Many gurus will tell you that you should not compare GA4 data with GA3 data because both use different data models. I don't.

GA3 data model is based on sessions and pageviews.
Whereas the GA4 data model is based on events and parameters.

Thus both GA3 and GA4 can collect, process and report the same data differently.

However, that should not stop you from comparing GA3 and GA4 data.

It is, in fact, a good practice to do such comparisons.
Following are the main benefits of comparing GA3 and GA4 data:

#1 You can quickly detect anomalies in data collection.

For example,
Read 8 tweets
Dec 26
FAQ: How do I learn #GA4 without a website and analytics data?

You can learn about Google Analytics 4 without having your own website.

Use the following websites for learning #GA4: Image
1) Google Merchandise Store (shop .googlemerchandisestore .com) - It is an ecommerce website owned by Google.

This website sells Google-branded merchandise (apparel, bags, drinkware, stationery etc.).

2) Google' Flood-it' mobile app - It is a mobile gaming app from Google.
You can use the Flood it mobile gaming app to learn about Google Analytics 4 mobile app tracking setup and reports.

Google provide the analytics data on these websites via the Google Analytics demo account.
Read 8 tweets
Aug 11
Here are the 21 Important negative impacts of IOS 14.5+ updates on Facebook ads which have put FB ads on life support…
1) There has been a sharp decline in reported traffic and returning users from Facebook ads on mobile devices because of many people opting out of tracking. And this decline in traffic continues.

2) Lots of conversions are being attributed to 'Uncategorized' and 'Unknown’.
3) Sharp decline in the size of the website's custom audiences.

4) Lookalike audiences are no longer reliable because of the sharp decline in the size of the website's custom audiences.
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(