How to Link Social Media to Google Analytics

Cody Schneider

Seeing a spike in website traffic from social media is great, but which specific posts, platforms, or campaigns are actually driving it? Without the right tracking, you're looking at a blurry picture of your performance. This tutorial provides a complete step-by-step guide to properly linking your social media efforts to Google Analytics 4 so you can measure what's really working.

Why Bother Connecting Social Media to GA4?

Sure, you can see likes, comments, and shares directly on your social platforms. But these "vanity metrics" don't tell you the most important part of the story: what happens after someone clicks your link. By linking social media to Google Analytics, you can move beyond engagement metrics and start measuring business impact.

When you correctly track your social media traffic, you can answer critical questions like:

  • Which platform - Facebook, Instagram, LinkedIn, X - is sending the most valuable traffic that actually converts?

  • How did our "Summer Sale 2024" campaign perform on social media compared to our influencer collaborations?

  • Do users coming from TikTok videos purchase more than those coming from LinkedIn articles?

  • Which social channel gives us the highest ROI for our ad spend?

Connecting these dots allows you to accurately attribute conversions, better understand your audience, and confidently decide where to invest your time and budget for the best results.

The Key to Accurate Social Tracking: UTM Parameters

So, how does Google Analytics know that a visitor arrived from a specific link in your latest Instagram Story versus a link in your company's Facebook group? The answer is through UTM parameters.

Don't be intimidated by the acronym. A UTM (Urchin Tracking Module) parameter is simply a little piece of code - a tag - that you add to the end of a URL. These tags don't change the destination of the link, but they pass important information back to Google Analytics about where the click came from. It turns a generic link into a detailed report.

A URL with UTM parameters looks something like this:

https://www.yourwebsite.com/landing-page?utm_source=facebook&utm_medium=social&utm_campaign=summer_promo_2024

Everything after the question mark (?) is the UTM code, which is made up of key-value pairs separated by ampersands (&).

The 5 UTM Parameters Explained

There are five standard UTM parameters you can use. The first three are the most important and are often required by tracking tools.

  1. utm_source (Required): This identifies the source of the traffic, like the specific platform. Think of it as answering, "Which website sent the traffic?"Examples: facebook, linkedin, instagram, tiktok, newsletter

  2. utm_medium (Required): This identifies the marketing medium or channel. It answers, "How did the traffic get here?" For all your organic social posts, it's best to be consistent and use something like social.Examples: social, cpc, email, affiliate

  3. utm_campaign (Required): This identifies the specific promotion or campaign. It helps you group all your efforts for a single initiative. It answers, "Why is the traffic coming?"Examples: summer_sale_2024, new_feature_launch, webinar_signup

  4. utm_term (Optional): Originally created for paid search to identify specific keywords, you can adapt this for social media. For instance, you could use it to identify a target audience or interest group for an ad set.Examples: running_shoes, marketing_managers

  5. utm_content (Optional): This is used to differentiate between links that point to the same URL within the same campaign. It's perfect for A/B testing. For example, if you have a link in the post text and a 'Link in Bio' callout in the same post, you can track which one gets more clicks.Examples: image_ad, text_link, video_cta, link_in_bio_click

How to Build Your Tracking URLs: Step-by-Step

The biggest rule of UTM tracking is consistency. Google Analytics treats Facebook and facebook as two separate sources. Being sloppy with capitalization or spelling will splinter your data and make a mess of your reports. Here are two easy methods to create consistent and accurate tracking URLs.

Method 1: Google's Campaign URL Builder

Google offers a free, straightforward tool specifically for this purpose. It eliminates the risk of typos by building the URL for you.

  1. Navigate to Google's GA4 Campaign URL Builder page.

  2. Enter your website URL (e.g., https://www.yourwebsite.com/new-product).

  3. Fill in the fields for campaign_source, campaign_medium, and campaign_name. While the tool lists these as optional, they are essential for proper tracking.

  4. Fill in optional fields like campaign_term and campaign_content if needed for your test.

  5. As you fill in the fields, the tool automatically generates the full campaign URL at the bottom of the page.

  6. Simply copy this new URL and use it in your social media post, bio, or ad.

Method 2: Create Your Own Spreadsheet Template

If you're managing multiple campaigns or working with a team, a spreadsheet is your best friend for maintaining consistency. It acts as a central record of every UTM link you create.

Create a Google Sheet or Excel file with the following columns:

  • Base URL

  • Campaign Source

  • Campaign Medium

  • Campaign Name

  • Campaign Content (Optional)

  • Notes

  • Final Generated URL

You can use a simple concatenation formula in the "Final Generated URL" column to automatically build the link. This prevents errors and saves time.

This approach gives your entire team a clear, standardized way to create and log links, ensuring your GA4 data stays clean and reliable.

Best Practices for UTM Management

  • Stick to lowercase. To avoid splitting your data, make everything lowercase (e.g., facebook instead of Facebook).

  • Use underscores instead of spaces. Spaces can break URLs or get encoded weirdly. Use summer_sale instead of summer sale.

  • Create a shared naming guide. A simple document that defines your naming conventions (e.g., "Always use 'linkedin', not 'lnkd'") is essential for team alignment.

  • Don't use UTMs for internal links. Never tag links that point from one page of your website to another. This can override a user's original session data and disrupt your attribution.

  • Use a URL shortener. UTM-tagged URLs can be long and look messy. Use a service like Bitly to shorten your link before you post it on social media.

Where to Find Your Social Media Data in Google Analytics 4

Once you've started using your UTM-tagged URLs, it's time for the payoff. GA4 automatically sorts your incoming traffic based on these parameters. Here's where to find that valuable data.

Checking the Traffic Acquisition Report

This is the best starting point for a high-level overview. This report shows you where your website's sessions came from.

  1. On the left-hand menu in GA4, go to Reports > Acquisition > Traffic acquisition.

  2. The default primary dimension is Session default channel group. You can leave it as is, or you can change it to Session source / medium for a more granular view.

  3. Look for the sources and mediums you defined, like facebook / social or linkedin / organic_social. Here you can directly compare engagement metrics, user counts, and conversion events across all traffic sources.

  4. To see campaign performance, click the little blue '+' sign next to the primary dimension dropdown and add Session campaign as a secondary dimension. You will now see which campaigns drove the most sessions from which sources.

Filtering Directly by Campaign

If you want to compare the performance of all your campaigns against each other, regardless of the channel, you can make campaign your primary focus.

  1. Navigate to the Traffic acquisition report.

  2. Click the dropdown above the first column and change the primary dimension to Session campaign.

  3. You’ll now see a list of all your campaigns - from email, ads, and social media - ranked by traffic and conversions. This helps you identify your top-performing marketing initiatives at a glance.

Creating a Custom Social Media Report in Explorations

For a permanent, shareable report focused solely on social media, the Explore section in GA4 is incredibly powerful.

  1. On the left-hand menu, click Explore and then choose Blank exploration.

  2. Give your exploration a name, like "Social Media Performance Dashboard."

  3. In the "Variables" column, click the '+' sign next to Dimensions. Import the following: Session source / medium, Session campaign, and Session default channel group.

  4. Click the '+' sign next to Metrics. Import the metrics you care about, such as: Sessions, Engaged sessions, Conversions, and Total users.

  5. Drag Session source / medium and Session campaign from the Variables list to the Rows section under "Tab Settings."

  6. Drag the metrics you imported into the Values section.

  7. Finally, under Filters, drag Session default channel group and configure the filter to exactly match Organic Social.

You'll now have a clean, focused, and live report showing the performance of all your campaigns and sources that fall under social media traffic. You can come back to this report at any time to check on performance.

Final Thoughts

Setting up UTM parameters is the single most effective way to see a clear and accurate picture of your social media marketing inside Google Analytics. It elevates you from counting likes to calculating ROI and allows you to make data-driven decisions that save you time, optimize your spending, and bring you closer to your business goals.

While building UTMs and exploring GA4 reports is powerful, we know it can become another manual task on your already long list. Manually building URLs and navigating different reports for each platform is a process that still disconnects you from quick insights. That’s why we created Graphed. We connect directly to your Google Analytics, social media ads accounts, and dozens of other sources so you can get immediate answers using plain English. Instead of digging through reports, you can just ask, "Show me my top-performing social campaigns from last month by conversion rate," and an interactive dashboard is built for you in seconds.