How to Use URL Parameters for Facebook Ads Tracking

Facebook advertisers need every method available to properly and thoroughly track the impact of their campaigns. One tool available is URL parameters.

While the use of URL parameters shouldn’t replace your Ads Manager reporting, they can provide a backup related to the traffic sent to your website from an ad (or even organically from your page or some other source). They can also provide additional insight that Ads Manager alone can’t provide.

In this post, you will learn what URL parameters are, how to set them up (including a dynamic method), and how to use that information in Google Analytics.

Let’s go…

What Are URL Parameters?

URL parameters are details that are added to an end of a URL. You’ve likely seen them before, but you may not have known what they were. Let’s break down the components of URL parameters.

Here’s an example of a URL with parameters (parameters start with the “?”).

https://www.jonloomer.com/facebook-ads-optimization-problems/?utm_source=Facebook&utm_medium=Facebook_Right_Column&utm_campaign=Blog_Post_Promotion_-_Conversions&utm_content=Optimization_Problems

Each parameter will include a key and a value. The “keys” in this case are utm_source, utm_medium, utm_campaign, and utm_content. Each key has a value, connected with a “=” sign. Multiple parameters are separated with “&” signs.

Let’s assume we added these parameters to the URL of a Facebook ad. When someone clicks that ad and they go to my website, those parameters would appear at the end of the URL. I could use Google Analytics (or another analytics tool) to see some details about this particular visit.

Those parameters will tell me the following:

  • Source was Facebook
  • Ad was within the Right Column placement
  • The ad came from a Facebook campaign called “Blog Post Promotion – Conversions”
  • The promoted ad was called “Optimization Problems”

Add Dynamic URL Parameters to Facebook Ads

You can certainly add these URL parameters manually. You’d simply build it from scratch and add that code (starting with the “?”) to the end of the URL. There is a special field within ad creation to do that.

It’s much easier, though, to use the Dynamic URL Parameters Builder. This way, you can provide place-fillers so that Facebook can automatically inject details from the campaign.

Following are dynamic URL parameters that Facebook provides:

  • Ad ID: {{ad.id}}
  • Ad Set ID: {{adset.id}}
  • Campaign ID: {{campaign.id}}
  • Ad Name: {{ad.name}}
  • Ad Set Name: {{adset.name}}
  • Campaign Name: {{campaign.name}}
  • Placement: {{placement}}
  • Site Source Name: {{site_source_name}}

Most of these are pretty self-explanatory. Site Source Name is the platform (Facebook, Instagram, Messenger, Audience Network) where your ad was shown.

When you create the ad, there are two “Build a URL Parameter” links, one under the URL (if you provide one) and one within tracking. The one under the URL will only appear when creating an ad from scratch. The one at the bottom will appear when promoting an existing post (the URL field won’t appear).

Facebook URL Builder

When you open the builder, it will look like this…

Facebook URL Builder

The campaign source helps identify where the traffic is coming from (Facebook, Instagram, etc.). You can use the site_source_name dynamic parameter here.

Facebook URL Builder

I like to use the Placement dynamic parameter for campaign medium. So, the source may indicate that a user came from Facebook, but the medium will provide the specific placement.

Facebook URL Builder

I use the Facebook campaign name dynamic parameter for campaign name.

Facebook URL Builder

As you can see in the note above, Facebook will use the original campaign name that you set when you publish. If you change the campaign name, Facebook will continue to use the original name for the parameter.

I use the ad name for the campaign content.

Facebook URL Builder

This is where it’s important that you use descriptive words in the ad name, and not the defaults.

You can also use custom parameters by clicking the Add Parameter button.

Facebook URL Builder

Ultimately, use whatever parameters you want!

Campaign Data in Google Analytics

Now, you can see data related to these parameters in your Google Analytics.

Within Google Analytics, go to Acquisition > Campaigns > All Campaigns on the left.

Google Analytics Campaigns

Know that you’re probably going to see lots of campaigns here, not just related to the URL parameters you created. Parameters are added to URLs all the time, particularly from your referral traffic. Don’t be alarmed.

Above the table, you’ll see links for Campaigns, Source, Medium, Source/Medium, and Other.

Google Analytics Campaigns

Under Other, you could search out Ad Content to find the ad name parameters, too.

Google Analytics Campaigns

Keep in mind that you are likely to use the same parameter for multiple campaigns in some cases. So, you may see “Facebook” as the source or “Facebook_Right_Column” as the medium, but they could represent multiple campaigns. This can actually be good for seeing how a particular source or medium does historically, assuming you use URL parameters regularly. If you click on a campaign, of course, you can then see the source, medium, and content for that specific campaign.

Now you can view things like bounce rate, pages per session, average session duration, and goals completed from people who clicked these ads.

Facebook Review Bot

Something to watch out for is that when you submit your Facebook campaign for review, Facebook will send bots to test the ads. This bot traffic won’t show up in your Ads Manager results, but it will show up in Google Analytics. The result will be a quick burst of traffic, but it will be no-value traffic.

Google Analytics Campaigns

You should either understand this up front when evaluating results, or you can eliminate the first day of a campaign to get more accurate numbers.

Things to Consider

First, understand that URL parameters are not a replacement for Ads Manager reporting. The numbers you get from Google Analytics using URL parameters will never match up with Ads Manager (for a lot of reasons).

This will give you more insight into what happens after people click on your ads and go to your website. It won’t account for view-through attributions or coming back a few days after a click to convert.

Also, know that links with URL parameters in them can be shared. So, imagine someone you targeted clicks your ad that included URL parameters. They are redirected to your website and like what they see. They decide to share that URL. The shared URL will also include those URL parameters (unless they remove them first).

The result is that some of the information you get in Google Analytics could technically be from people who didn’t click your ad. They clicked a link that was shared by someone who clicked your ad (or shared multiple times through the chain). This is another reason why you shouldn’t see this as a replacement for Ads Manager.

Finally, the Dynamic URL Parameters Builder is not available for all objectives. I won’t list them here since this kind of thing changes often, and Facebook is about to change its objective offerings (this article may keep an updated list). The bottom line is that if you don’t see the builder, it probably isn’t available for the objective you’re using.

Video Tutorial

Your Turn

Do you use URL parameters for your Facebook ads? How do you use and evaluate that data?

Let me know in the comments below!