Tracking Internal Marketing Campaigns With Google Analytics
Many websites use internal advertising in the form of banners or personalized product recommendations to bring additional products and services to the attention of visitors and to increase conversions and leads.
Naturally, the performance and effectiveness of internal marketing campaigns should be assessed, too, as this is one of the most powerful instruments for generating more leads, more conversions and more revenue on your website. In many cases, web analysts use Google Analytics’ UTM campaign parameters to track internal advertising.
For those of you who are not familiar with UTM parameters, this is what an internal link could look like if you add UTM parameters:
www.yourdomain.tld/superproduct.htm?utm_source=internal&utm_medium=internal-ads&utm_campaign=cross-selling
The problem: UTM parameters are intended to be used in external campaigns (for example, promoted posts on Facebook). Unfortunately, they are not suitable for tracking internal campaigns. In this article, I'll explain why you would corrupt your Google Analytics data when using UTM parameters for internal tracking purposes.
The solution: I have developed a set of URL parameters (called ITM parameters) that make tracking internal marketing just as simple and convenient as the familiar UTM parameters. Set-up takes a little time, but then you'd have a means of tracking internal marketing that both is easy to use and delivers accurate data. This article presents the solution and includes a precise description of all the necessary steps.
Collecting Data, The Powerful Way
Did you know that CSS can be used for collecting statistics? Indeed, there's even a CSS-only approach for tracking UI interactions using Google Analytics. Read a related article →
Can Internal Marketing Campaigns Be Tracked With UTM Parameters?
Well, yes and no. There's no technical problem with using UTM parameters for internal links as well. However, in the context of web analytics, it is definitely not advisable! As soon as a visitor clicks on an internal link with UTM parameters, their current session in Google Analytics is ended and a new session is started with the source
and medium
information from the UTM parameters. This has disagreeable consequences for your data in Google Analytics:
- The number of sessions counted increases artificially, because every click on an internal link with UTM parameters results in a new session.
- A conversion can no longer be traced back to the original, external source of the traffic, because the new session uses the
source
andmedium
information from the UTM parameters, which makes it more difficult to quantify the contribution of various external traffic sources to your conversions.
- If a new visitor clicks on an internal link with UTM parameters right on the landing page, this immediately results in a new session. The upshot of this is that the bounce rate for visitors from external sources increases artificially.
Naturally, you want to avoid these negative consequences, because they reduce the quality of your website's analytics.
Nevertheless, the use of UTM parameters to track banners ads and product recommendations is widespread. For one thing, many web analysts are unaware of the problem described above. But the deciding factor is something else: The UTM parameters are easy to use, very flexible and accessible, even for the less technically adept among us, which is why they are so often misused for internal campaigns.
In my blog post "Tracking Teasers and Internal Links in Google Analytics" (in German only, unfortunately), I've already covered how clicks on internal banner ads can be monitored and evaluated using event tracking or enhanced e-commerce tracking.
In practice, I've discovered that setting up tracking is too much for many people and/or they don't follow through with it systematically. As a result, they fall back on using the UTM parameters for internal purposes.
So, I asked myself the following question: If the UTM parameters are so popular, can I find a way to track and evaluate internal marketing campaigns using URL parameters?
Tracking And Evaluating Internal Marketing Campaigns Using URL Parameters
The answer is yes, it is possible!
Not with UTM parameters, because the type of evaluation you can do with these is predetermined in Google Analytics. What we can do, however, is define a new set of URL parameters that we then use to track internal marketing campaigns.
I call these parameters simply ITM parameters. Instead of using utm_source
, utm_medium
and so on, you would now use the parameters itm_source
, itm_medium
and so on for tracking your internal advertising. I consciously took the names of the UTM parameters, so that existing URLs can be easily modified with "find and replace."
OK, let's get started. I'll show you how to use Google Tag Manager and Google Analytics to create a set of URL parameters for tracking internal marketing campaigns and for analyses.
ITM Parameters At A Glance
Drawing on the UTM parameters, we'll use the following ITM parameters to track internal marketing campaigns:
itm_source
This identifies the source of the traffic. In the case of internal ads, this is usually your own domain. However, if you employ cross-domain tracking or different ad servers, different traffic sources can appear in this field.itm_medium
This is the medium of the internal ad; for example, a banner or product recommendation.itm_campaign
This is the name of the internal marketing campaign.itm_content
This is a parameter to differentiate between similar content, or links in the same ad; for example,text_link
orbanner_468x60
.itm_term
This is the search keyword that triggered the internal ad. Alternatively, it could be a keyword to categorize the ad by content.
A URL that uses all five ITM parameters might look something like this:
https://www.mydomain.tld/superproduct.htm?itm_source=mydomain.tld&itm_medium=banner_ad&itm_campaign=sale-2017&itm_content=banner_468x60&itm_term=special_offers
Now we have to make sure that the information we are collecting with the ITM parameters is passed to Google Analytics and available for analysis.
Note: To analyze ITM parameters in Google Analytics, we need to create customs reports. In this article, I'll show you how to create these reports, but I've uploaded them to Google Analytics' Solutions Gallery, too! You're free to download the reports here and here.
Creating Custom Dimensions In Google Analytics
All of the information that we collect with the ITM parameters should be saved in Google Analytics. To this end, we'll create custom dimensions in Google Analytics. Here, we have to consider their scope: Should we create the new dimensions at the session or hit level?
Let's go back to the UTM parameters for a moment. The UTM parameters are session-level parameters — that is, the information regarding source, medium, campaign and so on applies to the entire session. What this means for internal campaign tracking is that only the information regarding the last link clicked is captured with UTM parameters.
However, if we want to measure the influence of internal ads on conversion rates, then we would be interested in all of the clicks on internal banners, not just the last one. For this reason, it is advisable to create the new dimensions in Google Analytics at the hit level (for example, pageviews) in order to record the individual clicks on banner ads accurately.
The catch is that session-based and hit-based dimensions can only be combined in custom reports in exceptional cases. That means that we can't combine conversions (session level) with individual clicks on banners (hit level), and it means that an internal promotion report, like the one we know from enhanced ecommerce, is not available as a custom report.
So, how do we solve this problem?
- We could capture the ITM parameters at the session level.
This allows us to use the predefined campaign reports in Google Analytics as templates for reports on internal marketing campaigns. This is similar to tracking with UTM parameters, which also don't provide detailed information at the hit level. Not ideal, but easy to manage. - Or we could capture the information from the ITM parameters at the hit level.
Then, we can't establish a direct relationship between the ITM data and conversions. However, we can use data segments to analyze precisely those sessions in which internal banners were clicked and, thus, determine the influence of internal marketing campaigns on conversions.
It's up to you which method to use. If you capture the information from the ITM parameters on a session basis, it will be easier to manage the reports in Google Analytics, but the data will be less precise. If you go with the second variant, you will capture very accurate click data for internal banners but will have to invest more time to link this data to your conversions.
Alternatively, you could employ both methods in parallel by creating two custom dimensions for each ITM parameter in Google Analytics: one at the session level, the other at the hit level. Then, you will be free to decide how you want to analyze the data. The disadvantage of this solution is that you need 10 custom dimensions in Analytics to implement it, rather than 5. This might be a critical point, since the free version of Analytics allows a maximum of 20 custom dimensions.
Creating Dimensions For The ITM Parameters
In the following step, we'll create two sets of dimension: one at the hit level and one at the session level. If you've already decided whether to count clicks on internal ads in sessions only or as hits only, then you'll only need to create the one set that you require.
Creating New Dimensions At The Hit Level
Click on "Admin" in Google Analytics. Select "Custom Dimensions" under "Custom Definitions" in the "Property" area.
Now click on “+ New Custom Dimension”:
- Name the dimension
itm_source_h
. The_h
at the end of the name indicates the scope "Hit." - Select "Hit" as the scope of the dimension.
- Now just click "Create."
Repeat these steps for the dimensions itm_medium_h
, itm_campaign_h
, itm_content_h
and itm_term_h
.
When you're done, you should have five new dimensions at the hit level in Google Analytics:
Creating New Dimensions At The Session Level
Repeat the steps again for the second set of dimensions (at the session level):
- Name the dimension
itm_source_s
. The_s
at the end of the name indicates the scope "Session." - Select "Session" as the scope of the dimension.
- Again, just click "Create."
Repeat these steps for the dimensions itm_medium_s
, itm_campaign_s
, itm_content_s
and itm_term_s
.
Now, you should have five new dimensions at the session level as well:
Google Analytics: Excluding Query Parameters
When you add the ITM parameters to your URLs, these enhanced URLs will also be displayed in Google Analytics (for example, in the content reports). In this case, you would see the same page twice: once with the additional ITM parameters and once without. We want to prevent this, because the content of the pages with and without ITM parameters would be identical. Thankfully, Google Analytics provides a simple means of excluding query parameters.
First, select your "Property" in the "Admin" view, and then the desired "data view." Under the "View Settings" menu item, you'll find the section "Exclude URL Query Parameters":
Enter the ITM parameters that are to be used for tracking in the field provided: itm_source
, itm_medium
, itm_campaign
, itm_content
, itm_term
.
Then, just save the changes, and we're done here.
Search Console: Adding ITM Parameters
Remember that the Google Bot will also find your URLs with the ITM parameters. This could mean that these URLs will also land in Google's index and cause duplicate content. We can prevent duplicates from arising with a minor tweak in Google Search Console. Select "URL Parameters" from the "Crawl" section in Search Console:
Now click on the “Add Parameter” button to let Google know that the ITM parameter doesn’t affect the page’s content:
- Enter
itm_source
in the "Parameter" field. - Select the entry "No: Doesn't affect page content (ex: tracks usage)" from the dropdown menu.
- "Save."
Repeat these steps for the parameters itm_medium
, itm_campaign
, itm_content
and itm_term
as well. When you're finished, all of the ITM parameters should be configured as follows:
Setting Up Internal Campaign Tracking In Google Tag Manager
Now that we have laid the groundwork, we finally come to the point that probably interests you the most: How will the ITM parameters be read with Google Tag Manager and be passed to the custom dimensions in Google Analytics?
This is surprisingly easy. All we need to do is store the content of the ITM parameters in user-defined variables and then send them to Google Analytics with the pageview
tag. That's it!
Let's begin
Creating User-Defined Variables
For each of the five ITM parameters, we're going to create a variable in Tag Manager. When a URL that contains one of these parameters is called, its value will be saved in the corresponding variable.
Click on "Variables" in the "Workspace" in Tag Manager and then on "New" under "User-Defined Variables".
In the window that opens, we’ll define the first variable, itm_source URL-Parameter
, where we’ll be storing the value from the URL parameter itm_source
.
- Name the variable
itm_source URL-Parameter
. - Select "URL" as the variable type.
- Select "Query" as the component type.
- The query key is
itm_source
. This is the name of the URL parameter that is going to be saved in this variable. - Make sure that "Page URL / Default" is selected under "URL Source."
- Click "Save" to finish defining the variable.
Repeat these steps for the four other parameters (itm_medium
, itm_campaign
, itm_content
and itm_term
).
Once you're finished, there will be five variables available in Tag Manager to save the values from the ITM parameters.
In this screenshot, you can see not only the five newly created variables (itm_xxx URL-Parameter
), but also five additional variables with the type “Constant” (itm_xxx Index
). Let’s take a closer look at the variable itm_source Index
:
The variable itm_source Index
is a constant and has the value 14
.
What is it good for?
In the next step, we're going to send the contents of the five itm_xxx URL-Parameter
variables to the custom dimensions we prepared in Google Analytics. Each of these custom dimensions is addressed using an index number. In the example, the index number for the dimension itm_source
is 14
(see the section "Creating Dimensions for the ITM Parameters"). In your case, the number will probably be different. If you use the custom dimensions in different tags, you will probably have to check the number of the relevant dimension every time in Google Analytics. That's why I like to save the dimension number in its own variable — so that I don't have to remember it. Saving the index numbers in separate variables is not necessary; you can also just address the dimensions in the tag directly with the respective number.
Enhancing The Pageview Tag For ITM Parameters
Even with the most basic configuration of Google Analytics and Tag Manager, you will have at least one tracking tag activated — namely, the tag used to send the pageviews to Google Analytics. This tag is ideally suited to be enhanced for the ITM parameters.
Click on "Tags" in the "Workspace" in Tag Manager, and then select the tag with the trigger "All Pages":
Clicking on the name of the tag will display its details:
Make sure that the “Track Type” is set to “Pageview.” This is the tag used to send pageviews to Google Analytics.
Open the configuration page for the tag, and add the ITM parameters:
- Open the "Custom Dimensions" area.
- Click on the button "+ Add Custom Dimension."
- Enter the variable
{{itm_source Index}}
in the "Index" field and the variable{{itm_source URL-Parameter}}
in the "Dimension Value" field. In this way, the content of the URL parameteritm_source
— which we saved before in the variableitm_source URL-Parameter
— will be passed to dimension number 14 in Analytics. - If you don't use variables to save the index numbers, you can simply enter the respective number here (for example,
15
). Add the four remaining dimensions for the variablesitm_medium-URL Parameter
,itm_campaign URL-Parameter
,itm_content URL-Parameter
anditm_term-URL Parameter
. - "Save."
Here, at the latest, you'll have to decide whether the information from the ITM parameters should be saved at the session or hit level in Google Analytics. In the example above, I used the index numbers of the session-based dimensions. You will have to adjust this according to your needs.
Now that we have enhanced the pageviews tag, don't forget to publish the changes in Tag Manager. Now, when the requested URL contains additional ITM parameters, Tag Manager will read them and pass the information to Google Analytics.
Evaluating Internal Marketing Campaigns In Google Analytics
After you have finished setting up ITM parameter tracking in Tag Manager, it's time to take a closer look at the analysis options in Google Analytics. In doing so, we will have to decide whether to save the ITM parameters at the session or hit level (see the section "Creating Custom Dimensions in Google Analytics").
Session-Based Evaluation
If you save the ITM parameters in custom dimensions with the scope "Session," then evaluation of the internal marketing campaign will work in much the same way as with UTM parameters. As I've already mentioned, the disadvantage of this method is that there is only one set of ITM data for the whole session, which is overwritten each time a URL with ITM parameters is clicked. As a result, you will only see the information relating to the last click on an internal banner. Of course, this was already the case when using UTM parameters.
Session-based tracking of ITM parameters is more convenient in terms of web analytics, but less accurate than capturing the ITM parameters at the hit level.
Creating A Custom Report
The simplest way to create a custom report for evaluating internal marketing campaigns is via the standard reports for campaigns. In Google Analytics, select the report via "Acquisition" → "Campaigns" → "All Campaigns." You can then modify this report to suit your evaluation requirements by clicking on the "Customize" button.
I've made the report for session-based evaluation of internal marketing available in the Google Analytics Solutions Gallery.
This is what it looks like:
- I named the report "Internal Marketing Campaigns (session-based)."
- The report has two tabs: an "Explorer," which you can see here, and a "Flat Table," which is visible in the next screenshot.
- The "Explorer" tab can have various freely customizable metric groups.
- The "Explorer" drills down through the dimensions
itm_campaign_s
→itm_content_s
→itm_term_s
. So, the internal marketing campaign level is immediately visible in this report. The two other dimensions,itm_source_s
anditm_medium_s
, can be added easily as required. - I included a filter, so that the report only displays sessions where the
dimension itm_campaign_s
is not empty.
Let's look at the second tab in the report:
- This tab features a flat table which is well suited for exporting the data.
- The table uses all of the session-based dimensions that store ITM parameters:
itm_source_s
,itm_medium_s
,itm_campaign_s
,itm_content_s
anditm_term_s
. - The specified metrics are freely customizable.
Important tip: The table only displays sessions that have values in all five(!) ITM dimensions. If, for example, you don't use the parameter itm_term
, then the dimension itm_term_s
will remain empty, which means that no sessions would be displayed in the table. We can eliminate this restriction in two ways: either by removing the unused dimensions from the report or by using Google Tag Manager to set a default value in the dimension if the corresponding ITM parameter is empty. The second option necessitates more work in Tag Manager, as we would then have to distinguish between mandatory parameters and optional parameters.
Session-Based Evaluation Of Internal Marketing Campaigns
With the aid of some simple example data, I'd like to illustrate how the data from internal marketing campaigns is presented in this report.
In the "Explorer" tab, it is possible to combine various dimensions with one another; for example, itm_campaign_s
(marketing campaign) and itm_content_s
(ad content):
Or you can analyze the effectiveness of internal marketing campaigns in relation to the external traffic sources. This, for instance, is not possible with UTM parameters:
The table contained in the report provides you with a session-based view of all the ITM parameters and makes it simple to export data for further processing in Excel, Google Docs, etc.
Hit-Based Evaluation
Hit-based evaluation of internal marketing campaigns provides you with an accurate overview of how often specific advertising content has been clicked. However, an additional step is necessary in order to establish the relationship to the conversions achieved. This makes this method of analysis more time-consuming than session-based evaluation. However, it enables more sophisticated analyses.
Creating A Custom Report
There is no standard report for hit-based evaluation that we can take and customize for our purposes, so we'll have to create our own report that will provide us with information on how often the individual pieces of ad content have been clicked. Based on this report, we will then infer the data segments that we need for our analysis. But first, the report.
I've also made this report available in the Google Analytics Solutions Gallery.
This is what it looks like:
- I named it "Internal Marketing Campaigns (hit-based)."
- The report has two tabs: an "Explorer," which you can see here, and a "Flat Table," which is visible in the next screenshot.
- I kept the "Explorer" tab simple; it should provide you with an overview of the usage of internal advertising over time. That's why it only contains a single metric group with the metric "Hits."
- The "Explorer" drills down through the dimensions
itm_source_h
→item_medium_h
→itm_campaign_h
→itm_content_h
→itm_term_h
. - I included a filter so that the report only displays sessions in which the
dimension itm_source_h
is not empty.
Let's look at the second tab in the report:
- This tab features a flat table that provides you with an overview of the clicks on different advertising content and that is well suited for exporting the data.
- The table uses all of the hit-based dimensions that store ITM parameters:
itm_source_h
,itm_medium_h
,itm_campaign_h
,itm_content_h
anditm_term_h
. - I only used the metric "Hits." The session-based metrics such as number of conversions cannot be combined with the selected dimensions.
Important tip: This table also only displays hits that have values in all five(!) ITM dimensions. If, for example, you don't use the parameter itm_term
, then the dimension itm_term_h
would remain empty, which means that no hits would be displayed in the table. In this case, you would either have to remove the unused dimensions from the table or use default values for the parameters (see above).
Hit-Based Evaluation Of Internal Marketing Campaigns
As I already mentioned, combining hit-based data (such as clicks on internal ads) and session-based data (such as conversions) directly is not possible in Google Analytics. That's why we first use the custom report "Internal Marketing Campaigns (hit-based)" to identify data segments that we can then apply to the acquisition reports, for example.
Let's look at the report, jumping straight to the table this time:
In the table, we see the number of clicks (hits) on internal ads. The data is grouped based on the combinations of ITM parameters that occurred. In a sense, this is our raw data. Now we have to consider which data segments we can identify:
- In this example, there is only one internal marketing campaign, but this is already interesting as a data segment. We want to examine more closely how the number of conversions differs between sessions with and without clicks on internal ad content.
- Then, we drill down a little deeper and differentiate based on the dimension
itm_term_h
, which identifies ad content with a relationship to web analytics (webanalyse
) or AdWords (adwords
).
Even with so little data, we can continue to slice it up into new segments. For example, you could create segments from the dimensions itm_term_h
and itm_content_h
to examine which type of ad content works better for itm_term_h = "webanalyse"
or itm_term_h = "adwords"
. But that's just a side note.
I'm not going to go into the details of creating the data segments. You can see the definition of the segments in their names.
We'll start with the segment itm_campaign_h = marketing2017
. To make the difference clearer, I also defined a segment that includes all of the users who didn't click on internal ads. This segment is named itm_campaign_h != marketing2017
. !=
is the operator for "not equal to."
- Even with these two simple segments, we can distinguish between users who clicked on internal advertising and those who didn't.
- We can see significant differences in the number of conversions and the conversion rate.
- We can examine the effectiveness of the internal marketing campaign in relation to the traffic sources. This data provides us with valuable starting points for better targeting and optimizing our internal marketing campaigns. Performing this kind of analysis is impossible if you use UTM parameters!
In the second short analysis, we'll consider the segments itm_term_h = webanalyse
and itm_term_h = adwords
. These segments enable us to differentiate based on the context of the internal ad with regard to content — in this example, therefore, AdWords (adwords
) and Web Analytics (webanalyse
).
- We can now distinguish between internal ads with the subjects AdWords (
adwords
) and Web Analytics (webanalyse
). Once again, I've activated the segmentitm_campaign_h != marketing2017
(users without clicks on internal ads) as a control group. - If we look at the number of conversions, we'll notice that the total of the individual segments (3 + 4 + 2 = 9) is greater than the total number of conversions. Here we might have expected that the sum of
itm_term_h = webanalyse
anditm_term_h = adwords
would be six conversions, but it is actually seven conversions. This is a consequence of hit-based evaluation. It is possible that users click on banner ads for AdWords and banner ads for Web Analytics during a single session. These users would, then, be part of both data segments!
Naturally, these examples are just a taste of the many analyses that are possible with data segments. But they clearly show how much more the potential for analysis is when clicks on internal ads are captured at the hit level.
Recommendations
- Don't use UTM parameters to track internal marketing campaigns. They are intended for external campaigns. If you use these parameters internally, you'll lose information about the sources of the users' traffic. Moreover, you'll only ever have information about a user's last click on an ad.
- If you already employ ecommerce tracking on your website, you should check whether you can monitor your internal marketing with enhanced ecommerce tracking.
- If enhanced ecommerce tracking is not an option for you or you are looking for a solution that's easy to manage, then consider implementing tracking using ITM parameters.
- A little technical know-how is required to implement this method of tracking, but later on the parameters will be as easy to use as the UTM parameters.
- Give some thought to capturing data: Should clicks on internal banners be saved at the hit or session level? Both options have their advantages and disadvantages (data quality versus the time and effort of analysis). If necessary, you could even use both options in parallel. Then, you'd need ten custom dimensions in Analytics instead of five. Using both methods in parallel would allow you to compare them directly.
- The five ITM parameters that I presented here are not set in stone. I chose them because they make the switch from UTM parameters simple. If you require additional data, adding further tracking parameters is easy.
All done! This article ended up being much longer than I originally planned.
Thanks for sticking with me right to the end and for taking on the challenges of tracking and analyzing internal marketing campaigns with me. As you've seen, there are a number of decisions to be made and various settings to be configured.
But they're worth the effort — internal advertising is one of the most powerful instruments for generating more leads, more conversions and more revenue on your website. In order to employ this instrument profitably, you'll need data that allows for the evaluation and optimization of your internal marketing campaigns. Particularly if you're offering personalized product recommendations and the like, detailed data is indispensable for identifying jumping-off points for optimizations.
All the best in the analysis of your internal marketing campaigns!
Related Links
- The reports presented in the article have been uploaded to the Google Analytics Solutions Gallery.
- "Enhanced Ecommerce" (tracking), Google Analytics
Further Reading
- How To Build Server-Side Rendered (SSR) Svelte Apps With SvelteKit
- Accessible Target Sizes Cheatsheet
- Tracking Internal Marketing Campaigns With Google Analytics
- How To Use Heatmaps To Track Clicks On Your WordPress Website