Blog

+ Free advice and other musings

How to Track Facebook Ads & Instagram Ads in Google Analytics with URL Dynamic Parameters

by | Aug 21, 2020 | Google Analytics

Most marketers are familiar with Google’s Campaign URL Builder, which allows you to easily add campaign parameters to URLs so you can track Custom Campaigns in Google Analytics.

Email marketing tools like MailChimp also use UTM codes to tag the URLs of specific email marketing campaigns. Tracking the campaign source, medium, and name in Google Analytics gives more meaning to the data and helps marketers better understand the behaviour of that specific campaign audience.

When URL parameters are not used on Facebook or Instagram ads, then the Source/Medium reports in Google Analytics show the traffic source as the ad_id number. You could go look up the ad id in your Facebook ad reports, but it would be much better to build URL parameters.

In Facebook Ads Manager, at the Ad level, click “Build a URL Parameter” to open up the builder.

Note that you can also build a URL parameter in the Tracking section at the Ad level. My advice is to pick one and be consistent across all your ads.

Use the form to enter the parameters you want to track.


Be sure to create a naming convention that you can use across campaigns. This makes it easier to search, sort and interpret what finally appears in Google Analytics.

For example, if you want to track a video ad for ProductYellow, shown on Instagram to your US audience, then you can use dynamic parameters to pull in the values for the source, campaign name, and campaign content. Alternatively, use this builder exactly as you would the Google URL Builder and type in exactly what you want to appear.

It is important to use descriptive text in the Campaign Name field and Ad Name field.

For example, I recommend including in the Campaign Name, the name of the product being promoted, the target audience and the campaign objective or descriptor. Something like:

ProductYellow – US – FallSale

For Campaign Content, I like to describe the ad content so in analytics I have some context for what the ad was for, the ad type (single image, video, carousel), and the call to action (Buy Now, Learn More). Something like:

ProductYellow_CustomerStory – IG Video – LearnMore

[Update Mar 2022: A more recent post on using URL parameters is available here. ]

Further Reading

You may also like …

How to Track Marketing Campaigns in GA4

How to Track Marketing Campaigns in GA4

Holiday campaign tracking provides insights into what's working or not working. But you need to set it up. It's 5 weeks and 3 days until Black Friday, and even if your business is not located in America, this retail event kicks off the holiday shopping season around...

read more