Getting Down & Dirty With Campaign Variables For Social Media

When you’re determining social media ROI, sometimes you’ve got to get your hands dirty. With data, of course.

Specifically, let’s talk about campaign variables. It’s an off-puttingly science-y name for a concept that’s really pretty simple: Tagging all the links you send out via social media channels to keep track of how they’re doing. The tags you add send specific data to Google Analytics that’ll help you analyze your social media performance. Want to know whether you should spend more time on Facebook or Twitter? Or if Pinterest is as good for traffic as everyone says? Campaign variables can help.

You can add these tags to all kinds of links, but social traffic is what we’ll be focusing on here. When should you use them? Pretty much always. To really see the patterns that will help you make smarter decisions, you’ll need to use unique campaign variables for every post that references your content on every channel where you’re active. It can be time-consuming, but the results are worth it.

As long as your site is set up with Google Analytics, you can get started right away. Here’s what you need to know.

How to Plan for Campaign Variables

Before you start building URLs, think through your strategy first. Google Analytics’ link tagging capabilities allow you to identify virtually anything you can think of, which is good news for all us social media managers with an ever-increasing number of channels to deal with. But it also means it’s important to stay organized.

First, lay out each social media platform you’re working with: Twitter, Facebook, LinkedIn, Google Plus, anywhere you’re actively posting content. You need this list because you’re going to create a unique and consistent campaign code for each channel.

Then, think about all the types of content you regularly send out on social media channels and determine the best ways to categorize them to study later on down the line. Your content buckets might include things like blog posts, press releases, contests, sales, special offers, linkbait, landing pages and more.

For reporting purposes, try to keep your buckets fairly big (i.e. don’t get down to the level of creating a campaign for each new blog post). This way, you can see the bigger picture later but also break them down into smaller segments if you want.

How to Build URLs for Campaign Variables

Now we’re ready to build some URLs using the lists we just created.

There are a few different spots you can go to for help with the process of building your URLs. Google offers a URL building tool, and so do third-party tools like (full disclosure: this tool was built by Raven Tools, where I work), ROI Revolution, HubSpot and others.

google-campaign-variables You don’t have to use all five fields you’ll see in the URL Builder in each of your links. In fact, we’re only going to need Source, Medium and Name (the three mandatory fields).

Campaign Source: This is how the visitor got to your site. Your source will be the name of the social network you’re posting on, from our list of channels above.

Campaign Medium: The medium offers more information about the source. For our purposes, let’s make the medium something like “social” or “social media”. Choose one and stick with it across all channels.

Campaign Name: The campaign name is how you’ll identify the specific content, promotion or campaign the post was about. Your name will be whatever kind of content you’re posting, pulled from our list of content buckets above. For example, if your social media post was in reference to a one-day sale, your campaign name might be “one-day-sale.”

You should end up with something that looks like this:

As you build out your campaign variable, remember to be consistent. Stick with the same terms throughout, including capitalization and singular vs. plural. A difference of “Twitter” vs. “twitter”; “GPlus” vs. “GooglePlus”; or “blog” vs. “blogs” will make your results harder to find. If multiple members of your team are creating these URLs, you might want to create a chart everyone can consult.

All this can take some time, but a growing number of social media and Internet marketings tools allow you to add your campaign variables right through their interface, which can save you a significant amount of time.

How to Analyze Campaign Variables

OK, now the hard part is done and it’s time to see how you’re doing. All your great new data should start to show up within a day in Google Analytics. Navigate to Traffic Sources and then Campaigns. From the list you’ll see, look for the campaign names you assigned above as the “Name” element. Clicking on any campaign will show you the breakdown of visits each of your different social networks brought it for that campaign.

If you’re tracking goals for your site like conversions, sales, downloads or other behaviors, your campaign variables can take you all the way to a dollar figure.

Bonus tip: Once you’ve gotten consistent with tracking your URLs, you’ll begin to discover all sorts of new ways to use campaign variables. This is where the optional fields we left blank can come back into play. Why not consider some creative ways you could use them? For example, if you’re a fan of second-chance tweets (sending out the same link twice, a few hours apart, to account for different time zones and schedules) you might want to use one of those fields to differentiate the first and second tweet to see which version is more effective for you. As long as you’re consistent and clear on what you want to measure, how you use these fields is up to you.

Opinions expressed in the article are those of the guest author and not necessarily Marketing Land.

Related Topics: Channel: Social Media Marketing | Social Media Marketing Column


About The Author: is a content crafter at Buffer. She has been an editor and writer at publications including Allure, Time Out New York, Playboy and The Tennessean. She speaks frequently on social media marketing and community management topics.

Sign Up To Get This Newsletter Via Email:  


Other ways to share:

Read before commenting! We welcome constructive comments and allow any that meet our common sense criteria. This means being respectful and polite to others. It means providing helpful information that contributes to a story or discussion. It means leaving links only that substantially add further to a discussion. Comments using foul language, being disrespectful to others or otherwise violating what we believe are common sense standards of discussion will be deleted. You can read more about our comments policy here.
  • Kelly Stewart

    Nice article, Courtney. Campaign variables are so easy to set up but many marketers seem to be scared of them or don’t want to take the time to think ahead. Inevitably, down the road the boss or client asks “how did ‘Campaign A’ perform across all channels?” and you’re stuck pulling it all together manually in Excel. Been there. Don’t want to visit there again.

  • Courtney Seiter

    Thanks, Kelly. I agree! It can take a little time, but it’s well worth it to know your results. I think the hardest part is planning for a consistent, sustained effort with them. Once you’ve done that, it’s pretty easy!

  • Anonymous

    Courtney, thank you so much for the post. I read up on the URL building tool a few days about and went ahead and built links. The only thing that the article I was reading failed to mention was where to ‘analyse the variables’. That made their post pretty much useless (in my mind) because it missed out on a crucial step/process. Thanks for detailing how to find this information.  

  • Laila Sauer


  • Laila Sauer


  • Courtney Seiter

    Very happy to help! Yeah, that last step is pretty important. :)

  • simonswills

    I used to hand code my marketing factors into the URLs, now I can just do that from certain specific tools. I will to introduce it later.

  • Winooski

    Nice intro to campaign variables. Just an addendum: Don’t forget to have your landing page (indeed, probably every single page on the destination site) use the canonical link tag ( ). That way any social media link will keep building link popularity for its landing page in the “eyes” of search engines. E.g., instead of looking like,…

    …, if the canonical link tag is set up correctly as,…

    <link rel=”canonical” href=””/>

    …, then the search engines will increase the link popularity value for the canonical URL of the landing page: awesome-content-page.html

  • Hochzeitskleid

    looks so cool

  • Anonymous

    Do you needed money?Do you know you can borrow money easily?Just you needed to fulfill our some requirement.For more information you can visit our site

  • Courtney Seiter

    Very helpful tip! Canonicalization is super important. And fun to spell! ;)


Get Our News, Everywhere!

Daily Email:

Follow Marketing Land on Twitter @marketingland Like Marketing Land on Facebook Follow Marketing Land on Google+ Subscribe to Our Feed! Join our LinkedIn Group Check out our Tumblr! See us on Pinterest


Click to watch SMX conference video

Join us at one of our SMX or MarTech events:

United States


Australia & China

Learn more about: SMX | MarTech

Free Daily Marketing News!

Marketing Day is a once-per-day newsletter update - sign up below and get the news delivered to you!