Implementing UTM Parameters & Campaign Classification in Adobe Analytics
Sunit Sharma
Adobe Analytics & Launch Architect | AEP Qualified Expert | Adobe Certified Expert - Developer & Business Practitioner | Analytics Enthusiast & Adobe Analytics/Adobe Launch Trainer | Analytics Speaker
Accurate tracking of campaign performance is essential for making informed, data-driven decisions. In Adobe Analytics, UTM parameters allow you to track key campaign attributes such as source, medium, and campaign name with precision. This guide walks you through the process of setting up UTM tracking, configuring classification rules, and testing your setup to ensure smooth and accurate reporting.
1. Understanding UTM Parameters in Adobe Analytics
UTM parameters are tags added to URLs in the query string that help track the origin of traffic and measure the performance of marketing campaigns.
The most commonly used UTM parameters include:
utm_source (e.g., Google, Facebook)
utm_medium (e.g., email, CPC)
utm_campaign (e.g., summer_sale)
utm_content (e.g., banner, footer)
utm_term (e.g., keywords for PPC)
Let m
2. Setting Up Tracking Code in Adobe Analytics
To capture UTM parameters, use the following snippet code:
s.usePlugins = true; //This enables the use of custom plugins in Adobe Analytics//
s.doPlugins = function (s) { //The doPlugins function is where custom logic for processing and capturing data is defined.//
if (s.Util.getQueryParam('utm_medium')) {
s.campaign = s.Util.getQueryParam('utm_medium') + ":" +
s.Util.getQueryParam('utm_source') + ":" +
s.Util.getQueryParam('utm_campaign') + ":" +
s.Util.getQueryParam('utm_content') + ":" +
s.Util.getQueryParam('utm_term');
}
s.campaign = s.getValOnce(s.campaign, 's_campaign', 0);
};
This part checks if the utm_medium parameter exists in the URL. If it does, it concatenates the values of the UTM parameters (utm_medium, utm_source, utm_campaign, utm_content, and utm_term) into a string, using a colon (:) as a separator. This string is then stored in s.campaign.
领英推荐
Note: The getValOnce function ensures that the s.campaign value is stored only once per session or visit. If the same value appears again, it won’t overwrite the previous one. The third argument (0) specifies that the value should not be persisted across sessions.
This code is useful for capturing UTM parameters (commonly used in tracking marketing campaigns) from the URL and assigning them to the s.campaign variable, which can then be used for analytics purposes. The use of getValOnce ensures that the campaign data is only captured once during a single session or visit.
Setting Up Classifications in Adobe Analytics
Step 1: Define Classifications
In Adobe Analytics, go to Admin > Report Suites > Classifications. Add classifications such as Source, Medium, Campaign, Content, and Term to the Campaign variable.
Step 2: Utilize the Classification Rule Builder
The Classification Rule Builder streamlines the process of mapping UTM values. Use a regular expression (regex) pattern to break down the concatenated UTM string into separate classifications.
regex example:
Regex Pattern Breakdown:
^(.+)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)\:(.*)$
What it does:
This regex is designed to match a string that consists of multiple sections, each separated by a colon (:). Each section is captured in a separate group (up to 13 total groups).
Example Matching String:
first_part:second_part:third_part:fourth_part:fifth_part:sixth_part:seventh_part:eighth_part:ninth_part:tenth_part:eleventh_part:twelfth_part:thirteenth_part
google:cpc:christmas_sale
This regex splits the value into:
If some UTM fields are missing:
eg. source::campaign::term
In this case, the second and fourth fields will be captured as empty values.
After Configuring UTM Tracking and Classifications:
UI/Web Developer| Improving Web Vitals | Responsive Design | Media Queries | Bootstrap | Google PageSpeed Insight | Emailers | jQuery| Git | Adobe Target | DTM | Adobe Launch
3 周Informative ??
Leader in Digital Transformation, Marketing Analytics, Marketing Sciences, Omnichannel Commerce
1 个月Nice tip