Knowledge Base      


Can I use Facebook’s URL Parameters as Sub-IDs?


Absolutely!

To understand this article, you must understand what a “query string” is. If you need to catch up on query strings, read this article:
 
What is a “query string”?
 

When you create a Facebook ad, there is a “Tracking” section where you can create a query string to pass Sub-ID data to your ClickMagick tracking link.

Just go to the Tracking section of your ad and enter your query string in the edit box that says URL Parameters.
 
When your ad is clicked on, Facebook will automatically add a “?” mark to your tracking link to start the query string and then append your URL Parameters after the “?”. Facebook will automatically add the “?” character for you, so don’t include that with your URL Parameters.

Google Ads introduced 5 query string parameters you can pass data through that have become industry-wide standards. You’ve probably seen these before:
 
 
utm_source Typically your traffic source (Facebook, Google, Microsoft, YouTube...)
 
utm_medium The type of advertising: CPC, email, banner, etc.
 
utm_campaign A unique name for this advertising campaign. Example: cars
 
utm_term A sub-category of the campaign. Generally used to record the searched keyword or audience details. Example: electric-cars or tesla
 
utm_content A second sub-category of utm_campaign commonly used to explicitly define how the traffic was generated. For example, if you have two links in an email, link1 or link2, or in the case of a split test page-a or page-b.
 
 
If you don’t need sub-categories for your campaign, you can skip the utm_term and utm_content parameters. For instance, if you’re only running ads for Tesla cars and you don’t care about the details of exactly how the click was generated, you can set utm_campaign “tesla” and ignore the utm_term and utm_content parameters.

When you use Facebook’s URL Parameters, use whatever utm parameters and data you want, building them as a query string like this:

utm_source=facebook&utm_medium=socialmedia&utm_campaign=tesla


Facebook’s Dynamic Parameters

Facebook also has “Dynamic Parameters” such as {{ad.name}} and {{campaign.name}} that you can use to pull information directly from your ad. For example, if your campaign name was “Electric Cars” and your ad name was “Tesla”, then you could pass that information like this:
 
utm_campaign={{campaign.name}}&utm_term={{ad.name}}

When the ad is clicked on, Facebook will automatically replace {{campaign.name}} and {{ad.name}} with “Electric Cars” and “Tesla” before redirecting the click to your tracking link.

You can see all of Facebook’s Dynamic Parameters on this Facebook support page:

Facebook’s URL Parameters


The Order of utm Parameters are Important

You can pass utm values to ClickMagick in any order, and ClickMagick will store the first utm value as Sub-ID #1, the second utm value as Sub-ID #2, and so on.

For example, if the most important piece of information to you is the utm_campaign value, make sure you put that first in the list so it will be stored as Sub-ID #1, where you can view it most easily in ClickMagick stats:

utm_campaign=tesla&utm_source=facebook&utm_medium=socialmedia

Once these values have been passed to ClickMagick through your tracking link, you can pass them on through the Primary URL of that link using ClickMagick’s Sub-ID tokens [s1] through [s5], or you can use the explicit tokens [utm_campaign], [utm_source], [utm_medium].

If you want to pass all of the utm parameters together through your Primary URL, you can use the [query_string] token and ClickMagick will insert the Facebook URL Parameters into your Primary URL exactly as you entered them in Facebook:

https://target_domain.com?[query_string]


More on ClickMagick Sub-IDs

For more information on Sub-IDs, how to read them in your stats, and how to pass them through your Primary URL, read this article:

How do I use Sub-IDs?


The first part of that article shows the standard, non-Facebook way of passing Sub-IDs to your tracking links. You can safely ignore that section if you’re only interested in Facebook URL Parameters.

The final part, entitled “Passing Sub-IDs to your Primary URL,” explains how you pass Sub-IDs from your tracking links to your Primary URLs no matter where the clicks are coming from—including Facebook.
 
 
Note: Before utm parameters became an industry-wide standard, ClickMagick supported the 5 parameter names fbtag1 though fbtag5 instead of the utm names. ClickMagick will be dropping support for the fbtag parameter names, so switch to using utm names as soon as possible. For more information, read this article:

What happened to the Facebook "fbtag" parameters?
 
 
Caution: Make sure that the tracking links in your Facebook ads always end with a forward slash “/”. For example:

https://link-domain.com/myfacebookad/

If you forget the final “/”, your link will not work!


Article 66 Last updated: 06/05/2023 5:37:05 PM
https://www.clickmagick.com/kb/?article=66