Blog

How To Add Facebook Ad URL Parameters [The Right Way]

What are URL Parameters in Facebook Ads?

Facebook Ad URL Parameters are added to the end of your website URL to track where your visitors are coming from.

Why is it important to add Facebook Ad URL Parameters?

Well to better explain, let’s look at it this way:

I wake up late. As I rush to get ready I am convincing myself it was worth it. After all, I had a great time connecting with friends. Plus I work hard so it’s important for my health to let loose. Ya know? You most likely are familiar with this late morning dialogue. As I am about to head out the door I want to grab my keys…wait! what? I can’t find the dam keys! Where did I put them?

 

where are my keys

 

Ever been on a deadline to get campaigns live? Oh wait, the creative team is handing off final creative only 16 hours before launch! Great. 🤯 But with some ninja media buying skills, I get these ads live just on time. 😌 Now you want to check Facebook Ad Performance in Google Analytics and you take a look. Where the F**k are my Facebook campaigns???

This will happen if you forget to add Facebook Ad URL Parameters. However, with a consistent naming and tagging process in place, you can avoid the headache. 

Back to my late but well worth it morning. If I had a consistent place to put my keys every time I walked in the door I would not be scrambling to find them. Maybe one day I’ll get my sh*t together.

 

 

First things First – Facebook URL Parameters

 

Creating Facebook Ad URL Parameters can become a tedious task. This is why it is often a missed step by media buyers. Yet, setting up URL Parameters the right way is crucial for legible reporting.

This post will cover:

  • Defining a consistent naming convention leveraging UTM Parameter fields
  • Facebook Dynamic UTM Parameters (Facebook URL Builder)
  • Automated Facebook Ad tagging (EasyAutoTagging)
  • Manual Facebook Ad tagging (Bulk Export and Import)

But, I can’t talk about adding Facebook URL Parameters without going into the why. 

So let’s dig a little deeper than a lost key analogy.

This is especially true because everyone has a different approach on how to build a URL Parameter in Facebook. Below I will explain the process I have used tracking Facebook ads in Google Analytics.

Note: If you already know how to use URL Parameters and are looking to get to the how-to you can skip the next section.

 

Why Track Ads Across Facebook & Google Analytics?

 

If Facebook conversion tracking is in place why bother with tracking Facebook ads in Google Analytics?

There are a number of reasons. The main two being the difference in conversion attribution and reporting in silos.

  • Google Analytics tracks conversions on a last-click model. Facebook tracks conversion on a 28 post-click 1-day post-view attribution model.
  • Google Analytics is a channel-agnostic reporting platform. Even though they are part of the Google product stack. Facebook’s focus is on, well, Facebook.

It is important to understand how your ads are performing in the short and long term. To understand these trends you have to analyze performance across Google Analytics and Facebook.

Also, since Google Analytics is channel-agnostic. You are able to analyze data across channels in one place. If you have enough data volume you can also leverage Google Attribution.

Multi-Channel Funnels in Google Analytics can show you ad performance in a non-linear ecosystem. This is important for building funnels. As well as understanding a customer’s path to purchase.

It is equally important to look at platform performance metrics in the Ads Manager. Since Facebook tracks people, not cookies. It can tell you if people purchase further down the road. But Facebook cannot tell you how and if they have come to your site through other channels prior to making a purchase. Although you can get some insights into this using Facebook Attribution.

So to reiterate. To be an effective marketer tracking Facebook Ad Parameters in Google Analytics is important. Otherwise, you will have no way to find your Facebook campaigns.

Let’s take a look at what URL Parameters are.

 

How do URL Parameters Work?

 

URL Parameters are a string of characters you can append to any URL preceding a ? that contains custom campaign information you would like to track.

The five standard URL Parameters that Google Analytics uses are called UTM Parameters. They consist of five values that translate as Dimensions in Google Analytics.

The five UTM Parameters are:

Source

Medium

Campaign

Term

Content

Simply put, URL parameters consist of ‘tags’. You can append these ‘tags’ that contain campaign information to any URL. 

You can use URL Builders to generate these or create them manually. We will take a look at three ways to process UTMs. Manual tagging, automated tagging, and dynamic Facebook URL parameters.

First, let’s take a look at how you can define Facebook Ad URL Parameters specifically.

 

How To Define Facebook Ads URL Parameters

 

Bucketed data does not help us understand Facebook Campaign performance.  So at least we will want to segment data to these five dimensions:

 

Channel

Medium

Campaign

Audience

Creative

 

The default UTM Parameter fields we can leverage for this are:

 

utm_source – Source is used to track the primary name of the referer of traffic. Typically the name of the platform is used i.e. Facebook, Instagram

utm_medium – technically this is reserved for the marketing medium. For example ‘cpc’ or ‘referral’. But you can leverage this tag to track audiences.

utm_content – I use this field for ad level tracking i.e. Lifestyle Image 01. This will allow me to segment performance on the creative level.

utm_campaign – The campaign name

 

Note: Make sure the creative name is consistent across ad sets. Doing this will ensure that you can pull aggregated creative. Which is valuable to understand performance across multiple campaigns/channels/audiences. The same applies to audiences (Read: Ad Sets) used across multiple campaigns.

As an illustration here is an example of the Facebook Ad URL Parameter:

 

utm_source – facebook

utm_medium – Moms of Toddlers

utm_content – Lifestyle Image 01

utm_campaign – Kids Products

 

www.example.com/?utm_source=facebook&utm_medium=Moms+of+Toddlers&utm_content=Lifestyle+Image+01&utm_campaign=Kids+Products

 

A Few Things to Keep In Mind

 

UTMs are case sensitive – You can use capitals and spaces. However, upper and lower case letters are tracked in separate rows in Google Analytics. This can mess with data aggregation across a dimension. Having said that, using upper or lower case values is ok which for some makes reporting easier to read. Although there is no hard and fast rule, others prefer to keep all lower case and avoid using spaces. 

You can set lowercase filters to maintain consistency. If you want to make sure that all URL Parameters translate as lower case in GA. 

Consistent Naming Convention – This is super important. It is one thing to track ads using Facebook URL Parameters. It is another to organize your data and make it legible. Having a clear and consistent naming convention or UTM Profile cannot be stressed enough.

Default Channel Grouping – Using the medium field to track audiences goes against its conventional use. Its ok to do but keep in this will mess with your default channel grouping in GA. However, you can modify or create custom channel groupings to accommodate for this.

Custom URL Parameters – Custom Facebook Ad URL Parameters come in handy if you don’t want to modify default channels in Google Analytics. You can also use custom parameters to track additional information. This can be done mapping custom parameters to custom dimensions. A perfect solution for tracking non-standard campaign details such as Audience or Placement.

Don’t forget to tag new ads –  Make sure you are always adding URL Parameters to new ads. If you forget, Facebook traffic will be bucketed into referral traffic. You cannot retroactively update traffic in Google Analytics. Therefore, make sure that you have UTMs in place ad the onset of a campaign.

 

Building out Facebook Ad URL Parameters Across Multiple Campaigns

 

Building out unique URLs across campaigns can become a tedious and time-consuming task.

Although Google provides a basic URL Builder. Which works well for one-off links. However, the Google URL Builder not well suited for adding Facebook Ads UTM Parameters to campaigns with 100’s or 1000’s of Facebook Ads.

But there are three alternatives to generate Facebook Ad UTM Parameters at scale:

  1. Facebook Dynamic URL Parameters
  2. Automated – EasyAutoTagging
  3. Manual – Bulk Export and Import

 

 

(1) How to Add Dynamic Facebook Ad URL Parameters

 

Facebook released its own Facebook URL Builder. Then pulled it. Then re-released it. (Don’t worry this was back on 2018)

Their URL Builder allows you to use both static and dynamic values. What is the difference between static and dynamic?

  • Static values is any text you enter manually. For example ‘facebook’ or ‘cpc’
  • Dynamic values use Facebook campaign values. For example, the name-based value {{campaign.name}} will always populate that UTM field with its respective Facebook campaign name.

The Facebook URL Builder makes it easy to create these. Once you select a field it will show a drop-down with available dynamic values.

 

build a url parameter facebook

 

Using the example above here is what the fields filled out would look like.

 

example facebook url builder

 

If you do not want to skew Google Analytics default channels you can use custom parameters that would look something like this.

 

custom paramteres facebook url builder

 

Notice how I use Custom Parameters? This Facebook Add URL Parameter will have the typical medium value of cpc. Then I added a custom parameter utm_audience which dynamically pulls the ad set name.

This method works well for medium-sized accounts. Since Facebook Dynamic URL Parameters make it possible to update many campaigns at once. However, this does not save time if you have custom campaign parameters, that aren’t Facebook values.

Keep in mind: For name-based values, Facebook only uses the name at the time the campaign was published. If you change a campaign, ad set or ad name it will not be reflected in your UTM.

 

name based dynamic parameter values facebook

 

There are a few reasons this is not the best method:

 

  1. Not pulling name-based values. There is too much error-prone dependence. Because the individual setting up Facebook campaigns has to get the right naming structure set prior to publishing. Even if publishing campaigns in draft mode.
  2. Limitations of dynamic parameters. There is no scaleability if you need to add custom internal values to your UTM Parameters. In thas case, you are back to resorting to a manual process.

 

Let’s look at two other methods that are less human error-prone, can be scaled and are customizable.

 

(2) How To Automate Adding Facebook Ad URL Parameter

 

Given that the above process is still somewhat involved there is an easier way.

EasyAutoTagging is a simple and quick URL Builder. It auto tags Facebook ads using custom or dynamic values based on your UTM Profile.

 

 

Let’s take a look at how it works.

You can create a UTM Profile in the Profiles Section. A UTM Profile makes sure that your Facebook Ad URL Parameters stay consistent.

 

EasyAutoTagging UTM Profile

 

You can assign the UTM Profile to one or multiple data connectors.

 

EasyAutoTagging Data Connector

 

Data connectors are containers where you specify tagging details. You can select the Facebook account and Facebook campaigns using filters.

Continuous tagging – With continuous tagging selected EasyAutoTagging will auto-detect any new ads or name changes. Then process parameters using your defined UTM profile.

You can create one or multiple data connectors for each ad account. This allows you to assign respective UTM Profiles matching your naming convention and campaign type.

Using EasyAutoTagging:

 

  • Ensures URL Parameter Consistency across campaigns
  • Uses current values for dynamic name-based values
  • Automates the tagging process. This way you can’t forget to add Facebook Ad URL Parameters for new ads.
  • Imports Facebook cost data into Google Analytics using the same UTM Profile. This way you can report and analyze Facebook performance in Google Analytics.
  • New – View Google Analytics conversions for Facebook dynamic {{site_source_name}} and {{placement}} breakdowns.

 

You can find step by step instructions on how to do this here.

 

(3) How To Add Facebook Ad URL Parameters via. Bulk Export and Import

 

  1. Go to  the campaign view in Power Editor
  2. Select the campaigns with the ads you would like to tag
  3. Click export selected and save the generated CSV file

 

pasted image 0 18

 

Next, open the spreadsheet and navigate to the URL Tags column

Paste the following code into the first blank cell.

=”utm_source=Facebook&utm_campaign=”&B2&”&utm_medium=”&M2&”&utm_content=”&DL2

 

pasted image 0 21

 

Make sure that each UTM value is referencing the right cell respectively:

B2 – Campaign Name

M2 – Ad Set Name

DL2 – Ad Name

Select all empty cells in that column and hit ctrl D. Verify that the values look right.

Copy the entire column and paste values only

 

pasted image 0 22

 

ASCII Formatting

 

Now all characters outside the ASCII set will have to be converted into a valid ASCII format.

Therefore we need to encode any characters, such as space or dash, into a format that can be transmitted over the Internet. (W3schools has an ASCII Encoding Reference here.)

In this case, we only have spaces so we need to replace these with %20 or a +.

To do this perform a simple find and replace for all in this column and replace space with a +

 

pasted image 0 15

 

Your final results should look something like this:

 

pasted image 0 28

 

Save the spreadsheet.

Go back to Power Editor and import selected spreadsheet.

 

pasted image 0 27

 

You should see this message. If there are no errors or warnings click close. If you do have errors or warnings discard changes and start with a clean export.

 

pasted image 0 23

 

Note: Because you are re-importing the entire spreadsheet it can happen that Power Editor will show that more changes have occurred than just adding URL tracking parameters.

It’s a Facebook bug but I have not seen this as an issue since it is updating settings exactly matching the export.

 

pasted image 0 17

 

Spot check your tags at this step to ensure that the import was successful.

 

pasted image 0 20

 

If everything looks good you can apply changes.

Note: This is for Facebook URL parameter placement in the Ads Manager only. Make sure you Do Not include a ? at the beginning of the URL Parameters or none of your ad tracking will work.

 

Conclusion

 

Now it’s your turn.

How do you make use of Facebook Ad URL Parameters to track performance? What would you do differently?

 


 

Leave a comment

Your email address will not be published. Required fields are marked *

Hi, I would like to subscribe for this blog to obtain most recent
updates, so where can i do it please assist.

Reply

Hi Lauren,

You can do this via our pop up on any blog page.

Reply

After checking out a number of the blog posts on your
blog, I truly appreciate your technique of writing a blog.
I added it to my bookmark webpage list and will
be checking back in the near future. Please check out my
web site too and tell me your opinion.

Reply

I noticed dynamic parameters were not used for the site_source_name.
Is there a reason for that? Given campaigns on Facebook are typically activated on IG.
TY

Reply

Yes, Facebook does allow you to dynamically pull placements however they are formatted in this manner “facebook|feed|mobile_app” instead of “facebook” or “instagram|instagram_explore|mobile_app” instead of “instagram”. We will be adding this as an option but are also looking into a feature that will make it possible to re-write placement values into a clean source format.

Reply

Hey there, I’d like to know if it’s possible to track device type (for example mobile or computer) and gender for Facebook ad clicks using URL params.

Reply

I would recommend you leverage audience and demographic reports in Google Analytics segmented by Facebook Ad traffic to view device type and gender. You can measure conversions, CPA and ROAS down to Facebook site source and placements in Google Analytics using this approach.

Reply