I’ve been working on a project for a client and one thing they wanted to know was “what percentage of my overall traffic is from social media?”. This lead into a deep discussion of Reach on the channels they were engaging, and got me looking at creating some Advanced Segments to isolate traffic down to only refers from particular social media sites.

Depending on which type of analytics tool you use, your regular expression might differ, but because I spend 95% of my time in Google Analytics, I’m dedicated this post to it.

Like many things in life, there is more than one option for creating the same segment. John Doherty from Distilled wrote a great port on segmenting social traffic in Google Analytics one way, but I’m here to show you another way using regular expressions (also referred to as REGEX). I would recommend reading a beginner’s guide on regular expressions. Or, you may wish to download and print off a copy of the REGEX cheat sheet for your reference in case you plan to write your own advanced segment later on.

To include .com, or not to include .com? That is the question!

Without .com = facebook|twitter
With .com = facebook.com|twitter.com

Difference = 276

Do you see why? Ahh, people are using it in their URL!

Although the above value is not large in this sample, the number can slowly creep up to you if you are segmenting more channels that others have used in their URL, whether it be a sub-domain or within the domain itself.

**TIP: If you’re working on with a huge chunk of data and you run this Advanced Segment, you most likely will run it via “fast access mode”. To avoid this, you can go into your Traffic Sources report, paste your REGEX into your inline filter at the bottom (top for V5), and voila! You’ve escaped the fast access creeper (note: the inline filter for V5 is not set to REGEX initially and you would need to click on the Advanced link next to the text box to select it).

I hope this helps clean the data up a bit! Let me know if you would write the regular expressions differently, I’d be curious to know.

Message Sent

Thank you for registering.

Cardinal Path hosted a live session to connect with you and answer all your questions on Google Analytics.
Get all the expertise and none of the consultancy fees in this not-to-be-missed, rapid-fire virtual event.

Thank you for submitting the form.

Thank you for submitting the form.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Click here to download access the tool.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Success!
Your message was received.

Thank you.

Thank you for registering.

Cardinal Path is continuing with its series of free training. Next we are conducting training on Google Data Studio. Check it out here.

Message Sent

Thank you for registering.

Thank you for your submission.

Your request has been submitted and a rep will reach out to you shortly.

Message Sent

Thank you for your interest.

Thank you for registering.

You should receive a confirmation email from GoToWebinar with your unique webinar login information. If you do not receive this email or have trouble logging in to the event, please email asmaa.mourad@cardinalpath.com.

Thank you for subscribing!

You're now looped into the world's largest GMP resource hub!

Thank you for your submission.

Thank you for your submission.

Thank you for your submission.

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Thank you for your submission.

Thank you for your submission.

Message Sent

Thank you for registering.

Thank you for registering.​

Paid media spend by Government websites increased a whopping 139% YoY in 2020.

2020 Online Behavior Live Dashboard

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

2020 Online Behavior Live Dashboard

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Success! Thank you
for reaching out.