Sub topic 12
Set up tracking before launch
This chapter assumes you know the basic marketing terms (channel, conversion, audience) and the cost metrics from earlier chapters: CPC, conversion rate, and CPA. It covers how to make sure each channel's results can be told apart after launch.
Why tracking comes first
Your measurement plan follows from your campaign goal and your channel selection. If you pick one success metric, such as sign-ups, you need a way to count sign-ups per channel. Tracking set up after launch misses the early visits, and those visits cannot be recovered.
A simple measurement plan has four parts:
- The one success metric from your goal.
- The event that counts as a conversion, such as "form submitted".
- A tagging convention for every link you publish.
- A place and a schedule for reading the numbers.
Tag every link with UTM parameters
UTM parameters are labels added to the end of a URL. Analytics tools read them to attribute a visit to a source, a medium, and a campaign.
https://example.com/spring-offer?utm_source=newsletter&utm_medium=email&utm_campaign=spring_launchutm_sourcenames where the visit came from, such asnewsletterorfacebook.utm_mediumnames the type of channel, such asemail,cpc, orsocial.utm_campaignnames the campaign, herespring_launch.
Consistency matters more than the exact names you choose. Analytics tools treat Email, email, and e-mail as three different values, and your report will split one channel into three rows. Write the convention down and follow it.
Generate links from one place
Building links in code removes typing errors. This script checks each value against the allowed list and then builds the URL.
from urllib.parse import urlencode
ALLOWED_MEDIUMS = {"email", "cpc", "social", "content"}
def tagged_url(base, source, medium, campaign):
if medium not in ALLOWED_MEDIUMS:
raise ValueError(f"unknown medium: {medium}")
params = {
"utm_source": source.lower(),
"utm_medium": medium,
"utm_campaign": campaign.lower(),
}
return f"{base}?{urlencode(params)}"
print(tagged_url("https://example.com/spring-offer",
"newsletter", "email", "spring_launch"))
print(tagged_url("https://example.com/spring-offer",
"google", "cpc", "spring_launch"))The output is two links that share a campaign name and differ in source and medium. That lets you compare channels inside one campaign.
Check the setup before launch
Tracking that has never been tested often fails silently. Before launch, walk through this list:
- Click each tagged link and confirm the visit appears in your analytics tool under the right source and medium.
- Complete a conversion yourself and confirm the conversion event fires.
- Confirm the conversion is credited to the channel you clicked from.
- Check that redirects do not strip the parameters from the URL.
Connect tracking to your cost numbers
Tracking is what lets you compare your planned numbers with real ones. Your plan assumed a CPC and a conversion rate for each channel. After launch, tracked clicks and conversions give you actual values to compare against those assumptions. Without per-channel tracking, you can only compute one blended CPA for the whole campaign, and you cannot tell which channel is working.
Common errors
- Mixed capitalization or spelling in tag values, which splits one channel into several rows.
- Tagging external ads but not email links, which leaves email invisible.
- Tagging links that point to your own site from other pages. Internal tags overwrite the original source.
- Launching before testing the conversion event.
Exercise
Your report shows "email", "Email", and "newsletter" as three separate mediums for what is one email send. What caused this, and what should you change before the next campaign?
Show answer
The tag values were typed by hand without a convention, so spelling and capitalization differ. Define one lowercase list of allowed source and medium values (for example medium "email"), generate all links from that list, and test the links before launch.
Exercise
A tagged link to your offer page is clicked, but the visit appears as "direct" traffic. Name one likely cause and how to confirm it.
Show answer
A redirect or link shortener probably removed the query string. Click the link yourself, then check the final URL in the browser address bar to see whether the utm parameters are still present.