Blog

+ Free advice and other musings

How to Track Campaign Traffic in Analytics

by | Mar 30, 2022 | Google Analytics

Use URL Parameters when creating Facebook/Instagram ads so you can verify that traffic in the Campaigns report of Universal Analytics or the Traffic Acquisition report of GA4.

First, what are URL parameters and why are they useful to include?

URL parameters add information to the end of a URL. For example if you click on this Facebook ad and look at the URL in your browser window you will see a long list of parameters after the main part of the URL.

https://www.shopify.com/plus/guides/direct-to-consumer-guide?utm_source=facebook&utm_medium=cpm&utm_content=direct_to_consumer_guide&utm_campaign=2020-food-bev

Everything after the “?” are the parameters.

So the above example is showing us

  • link url is https://www.shopify.com/plus/guides/direct-to-consumer-guide

And, the marketer who set up the campaign defined the following parameters:

  • utm_source=facebook
  • utm_medium=cpm
  • utm_content=direct_to_consumer_guide
  • utm_campaign=2020-food-bev

Where are URL parameters set?

At the Ad level in a Facebook/Instagram campaign, under Website URL, click “Build URL parameter.”

Facebook ad setup for URL parameter

The pop-up box prompts you to enter the website URL for your ad, plus the various parameters.

URL builder in Facebook

The Shopify ad above would have used the following settings.

example url parameters

But, of course there is a better way to do this, which is Dynamic URL parameters.

Dynamic URL parameters require a good naming convention for Campaign, Ad Set, and Ad Name, but you should be doing that anyway, right!

Here’s the same Shopify ad but using Dynamic URL parameters.

How do you add dynamic URL parameters?

1. Click the data field to see the dropdown options.

2. For Campaign source select {{site_source_name}}

This will pull into your Analytics reports Facebook, Instagram or any other source, if you are using multiple ad placements.

Depending on where the ad appears, the site_source_name parameter has 4 possible values:

Facebook (‘fb’)
Instagram (‘ig’)
Messenger (‘msg’)
Audience Network (‘an’)

3. For Campaign medium select {{placement}}

The Placement {{placement}} parameter has 6 possible values depending on where the ad appears:

  • Desktop feed
  • Mobile feed
  • Right column of Facebook Messenger inbox
  • Messenger inbox
  • Instagram Feed
  • Instagram Stories

In Universal Analytics > Acquisition > Campaign reports ad traffic will then look something like this:

In GA4, the Traffic Acquisition report can be refined to show Campaign traffic

4. Back to the Facebook/Instagram ad setup, you can see from GA4 that Campaign Name is the field being pulled into the report.

Campaign, Ad Set and Ad Names {{campaign.name}} {{adset.name}} {{ad.name}}
These parameters will dynamically insert the name of the campaign, ad set or ad according to how you have named each during the setup. Facebook will put a caution flag up to remind you to double check the naming convention you have used.

The more descriptive your naming convention, the more valuable the reports.

For example if you leave ad name as the default setting “New Ad”, then after a few campaigns your analytics reports will show traffic from multiple ads called “New Ad”. Not very useful.

The ideal Campaign Name will include the following qualifiers:

  • Project Name or Item Promoted and Objective.

It would look something like this

Boxcar Marketing – GA4 Spring Webinar – Conversions
[Client or Project Name] – [Item Promoted] – [Objective]

Remember Campaign Name is what will show up in analytics reports so you can streamline this as you like. The important thing is to have a consistent naming convention for all your campaigns going forward.

The ideal Ad Set Name includes details about target audience, placement or scheduling. Things you might include:

  • Daily/Lifetime Budget
  • Scheduling
  • Audience Targeted
  • Placement
  • Optimization
  • Pricing
  • Other Variations

It would look something like this:

All Website Visitors (30 Days) – US&CDN – News Feed – Conversions
[Daily/Lifetime Budget] – [Scheduling] – [Audience Targeted] – [Placement] – [Optimization] – [Pricing] – [Other Variations]

Often I use a simplified version:

Engaged Audience (90 days) – 2022 Mar 1-15

The above means that the audience target is a custom audience based on engaged visitors to my site over the last 90 days, and my ad ran Mar 1-15, 2022

The ideal Ad Name

There are several qualifiers to consider here. If you are running multiple ads in a campaign, or A/B testing, then the ad name should describe those factors.

Consider including:

  • Ad Format (image, video, collection, carousel)
  • Copy/Imagery Details
  • CTA Button Used

It would look something like this:

GA4 Tour Post – Video – Learn More
[Ad Format] – [Copy/Imagery Details] – [CTA Button]

When you include URL parameters in your ad setup then you are able to better track what happens to that ad traffic once it arrives on your website.

In Google Analytics (Universal Analytics), you will find ad traffic under the Acquisitions > Campaigns report.

In Google Analytics 4 (GA4), you will find ad traffic under the Acquisitions > Traffic acquisition report when you select “Session Campaign” instead of “Session default channel grouping”.

Happy analyzing!

You may also like …

AMA | Ask Me Anything

AMA | Ask Me Anything

I had 3 great marketing questions posed to me last week and I thought I'd share my responses. Question 1: Is there a way to show the Full URL of pages being shown in GA4 Realtime reports? Unfortunately there is no way to modify the Realtime reports. What you see is...

read more
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