Tracking Internal Campaigns with Google Analytics

Internal campaigns are marketing efforts that are run on your site and promote your products and services. Here’s an example from the Boton Red Sox site. They’re using ads on the homepage to promote ticket sales.

Companies should track how people react to these campaigns and which ones are most successful. But what’s the best way to do this with Google Analytics?

Some people use the standard campaign tracking to track internal campaigns. THIS IS INCORRECT AND SHOULD NEVER BE DONE. Using the standard campaign tracking for internal campaigns will cause problems with your source data. So don’t do it!

There are a few correct ways to track internal campaigns. You could use Event Tracking, Custom Variables or Virtual Pageviews. But I like to use GA’s internal campaign tracking tool.

What? You’ve never seen or used the GA’s internal campaign tracker? It’s in the profile settings and it’s called Site Search tracking! Did I fool you ;)

Site Search can easily be configured to track internal campaigns. Let’s walk through the steps to set it up and then the data and analysis.

Step 1: Create a New Profile

Because we’re using Site Search for an unintended purpose it’s best to configure these settings on a new profile. It’s not possible to use Site Search for both tracking internal campaigns and internal site search within the same profile. You need to have a separate profile to track internal campaigns.

Step 2: Tag your Internal Campaigns

Once you’ve created your new profile it’s time to tag your internal campaigns. Internal campaigns need to be tagged in a similar manner to external campaigns: you need to add query string parameterrs to your internal ad.

However, unlike external campaigns you do not use the standard link tagging parameters (utm_campaign, utm_medium, etc.). You get to make up your own parameters!

You can use one or two parameters for internal campaign tracking and you can name then anything you want. The reason you can use one or two parameters is that GA’s site search configuration uses two parameters, one for the search phrase and one for the search category.

Whatever you choose, make sure the parameters are not used for anything else.

TIP: Check your Top Content report for a complete list of your site’s query string parameters. Verify that the parameters you create are NOT in this list.

For the sake of this post I’ll use the parameter icn (shor for internal campaign name). This parameter will holds the name of the internal campaign. I’m going to use the following format for the value of the campaign name parameter


I mentioned that you can use two paramters. You don’t need to use two, but GA’s site search can be confiugured to track the internal site search phrase and a site search category. We’ll use the category paramter to track the internal campaign name.

I’m going to name the second paraeter ici (short for internal campaign info). Again make sure the parameter you’re using does not already exist. This second parameter let’s me collect details about the ad the visitor clicked on and the location of the ad.

Here’s a basic format:


You can see that I’m stuffing a lot of information into the parameter. You can put whatever you want and GA will gladly suck it in. By adding more information we’ll get a granluar view of how the internal campaigns perform and which locations and variations lead to tbe most conversions.

If you don’t have different types of internal ads, or just don’t care about this level of detail, then you can ignore the add internal campaign info parameter. It blank, it’s up to you!

Now you need to define the values for all the ads. Thic can get messy if you’re running a lot of internal campaign. But you can do it, just be organized! Use a spreadsheet to keep track of all the values you use.

Once you’ve got al your parameters it’s time to tag your links. The exact process depends on your site. You may need to change static links, like this:

< a href=”/internal-page.php?icn=2010-spring-sale&ici=stubs_home-roller >

Or if you have complicate flash ads you may need to get inside the Flash code. It depends on your site.

The bottom line is when somone clicks on an internal ad you want to see your internal campaign parameter on the next page. If you don’t see the parameter in the URL then you did something wrong.

You can use the sample spread sheet below to track the different parameters you use for your internal campaigns. The spread sheet also has a formula in column D to automatically add the parameters to your URLs.

NOTE: There is an iFrame in this post. If you can not see it, you can view the original post here or view the Google Spreadsheet here.

Once youe’ve got the parameters added to your links it’s itme to configure the Site Search settings.

Step 3: Configure Site Search Settings

Remeber, we’re configuring these settings on a new profile so we don’t break the site search in our main reporting profile.

Site search has three settings. First, turn site search on.

Next, tell GA the name of the paramter that holds the site search phrase (in this case it’s out internal campaign name) by adding the parameter to the ‘Query Parameter’ filed.

Next, choose Strip Query String Parameters. This setting will remove the parameter from the URL after GA processes the data. This is a good idea because it reduces duplicate pages in your top content reports.

TIP: You probably want to exclude your internal campaign name parameter, and internal campaign information parameter, from your other profiles. It can really mess up your pageview data.

If you’re using an internal campaign information parameter configure the Site Search Category settings the same way. Just make sure you use your internal campaign info parameter in the ‘Category Parameter’ setting.

Here’s how the settings look using the parameters from my example:

That’s it! Let’s look at the data.

The Reports

Let’s start by answering a simple question: do people who respond to internal camapigns convert more or less than those that do not respond to internal camapigns? To answer this question use the Content > Site Search > Usage report. Here we can see that there were only eight visits that clicked an internal campaign. Sad! But it’s just test data.

Now let’s drill deeper ad identify which inernal camapigns are most effective. Use the Content > Site Search > Search Terms report. Rather than search phrases this report contains the names of all internal campaigns. Again, what was the response to the campaign? Was it worth the effort? Don’t forget to check the Goals tab and the Ecommerce tabs (if applicable) to measure outcomes!

But let’s drill deeper to understand which ads within those campaigns are working. Click on a campaign name and choose Category from the Analyze drop down.

Now we’re looking at all of the information that we put into the ici query string parameter for this particular campaign name. If we had multiple internal ads we’d be able to differentiate ad placements and creative variations.

Don’t forget to use the Goals and Ecommerce tabs to measure outcomes! This is what most people want to know: did internal campaigns, and specifically which internal campaigns, generated revenue and conversions?

But we can do more. Now change to the Content > Site Search > Start Pages report. Now you can see which page people were on when they click on an internal ad. Again, more insight into where visitors responded to an internal campaign.

And for all those marketing folks that are so concerned with internal campaigns, how about creating a nice custom report and automating the delivery or, better yet, use the Custom Report Sharing feature to share this report with others. People will love this because you can change the wording so it does not say Site Search it says Internal Campaigns Report.

But wait, there’s more! What about using a secondary dimension to view the external marketing campaigns (or sources, or mediums) that drive visitor to react to internal campaigns. Perhaps the extrnal creative has some influence over how visitors react to the internal campaign creative. The data isn’t so hot in the image below, but you get the idea.

And finally, the ultimate in analysis, internal campaign attribution. We can use the Search Term Refinement feature if visitors click on multiple internal campaigns. Google Analytics will track all subsequent site searches, but in our case follow up site searches are actually additional internal campaigns that the visitor responded to. Honestly, I have never found any insights from this type of analysis, but you can do it if you want!

Ok, I’ve officially entered nerdville.

I think you get the idea. By adding all this data you can do many different kinds of segmentation and analysis. More than enough to understand the behavior of your site visitors and how your internal campaigns perform.

Last but not least, I’ll mention that you can track internal campaigns using events and custom variables. But both of those solutions require coding. And that requires working with IT. Using Site Search, in most cases, will not require any code changes to your site.

Be Sociable, Share!

    Like this post? Sign up to get posts delivered to your inbox.


    1. says

      Clearly you don’t understand the concept of “dibs” :) No worries, I’m sure you’d already started the post before I’d “called it”.

      Great post, covers just about everything (except that you can also access site search/category parameters for dimensioning/segmenting purposes with GARE). Very well articulated. Props.

      • Justin says

        @Julien: I was so ready to put an advanced segment in there! But I felt myself going over the top.

        @Jeremy: Tis one has been sitting in the queue for months! Thanks for mentioning GARE, it’s really useful in this situation.

    2. Msseaseo says

      Some people use the standard campaign tracking to track internal campaigns. THIS IS INCORRECT AND SHOULD NEVER BE DONE. Using the standard campaign tracking for internal campaigns will cause problems with your source data.

      –> Can you explain more about this? What is the main problems when using traditional tracking method?

      Thanks a lot!

      • Justin says

        @Msseaseo: Adding the campaign tags to internal links will change the value of the campaign cookie (__utmz) during a session. This will then cause problems when GA processes the data. It causes issues with the visit and pageview attribution. GA get’s confused as to which campaign information should get credit for the data. Hope that helps and thanks for the comment.


    3. says


      thanks for this great post… One question:
      You are saying “TIP: You probably want to exclude your internal campaign name parameter, and internal campaign information parameter, from your other profiles. It can really mess up your pageview data.”
      So I guess you are proposing to edit our other profiles and remove icn and ici from the site search.
      My doubt here is taht you are asking to create a new profile in order to don’t modify the previous one, but then we also have to remove icn and ici from the previous one (modifying it). Am I missing something or doing something wrong?

      Thanks againd and regards!

      • Justin Cutroni says

        @ Bancos, You should create a new profile and specify the site search and category parameters are icn and ic, respectively. Then you should exclude those query string parameters from all other profiles that you are using. When you’re done you’ll have one profile for internal site search and all of your other profiles will be excluding the parameters used for internal campaign tracking.

        Hope that helps,


    4. says

      Hi Justin again,

      my question is that if I remove icn and ici also from my main profile, i would have in fact two profiles that are equal.

      In my main profile the only option that Ihave is as “query parameter” the character “s” for searches and the option “no, don’t strip….” So If i go now and I add ici and icn and I change to “Yes, strip…” in this main profile, it will be pretty much the same than the new one created for internal campaings and i will remove additionaly the “s” from my searches…

      At least as far as i understand this. May be I am missing something or my main profile is not configured properly…

      So, what is the difference if any between them?

      Thanks again

      • Justin Cutroni says

        @Bancos: Both profiles should be exactly the same EXCEPT the internal ad tracking profile will have ici and icn for the query parameters in site search and the main profile will use have ici and icn in the Exclude Query String Parameters setting in the profile settings. Does that make sense? I think you’re consufing the Exclude Query String Parameters setting in the profile settings with the Strip Query String parameters in the Site Search setting.

    5. says

      That was the point. I have it in spanish and I overlooked the proper term. Just in case for others, “Exclude Query String from the profile settings” is a text box just below “Time Zone”.

      Thanks for your help!

      BTW, I have checked your source code and you are using _trackpageview for external links. Does this “artificially” increase the pageviews of the site? I was using it in my web but with the last version of yoast plugin, now it tracks the outbound using “events” and not page views, what are your thoughts on this?

      Thanks again !

    6. Msseaseo says

      @Justin: thanks for your reply and explanation. Now I’m clear about what differences between tracking internal and external campaigns.

      But my questions are:
      1. If I also want to track my search function, how can I use your solution and Site Search tracking from GA at the same time?
      2. How do u think about using Event Tracking method? I’ve found this tutorial at
      Please let me know your idea! Thanks Justin!

      • Justin Cutroni says


        1. You need to track site search in one profile, and internal ad clicks in another profile. That’s the key to this entire setup.

        2. I don’t like using event tracking as you need to do more coding.


    7. says

      Hi Justin

      That is awesome, and way to many uses external campaign tracking for internal use.

      But there are still one problem remaining – Duplicate content. You cannot do what you are propose without coding, because you need to make nofollow OR add the parameter in the GA code and not the shown URL.

      Do you have an easy solution for this part? :)

      As times go by, it is not only about analytics (even though it is the funny part), but we webanalysts needs to think SEO etc into the solutions as well…

      • Justin Cutroni says

        @Jacob: Great point, SEO should be considdered when implementing this. One thing that I do is use Google’s webmaster tools to exclude the query string parameters from Google’s crawler. I know this isn’t the best solution, as there are other crawlers out there, but it helps.

    8. Big Tony says

      @Bancos – “Google no longer recommends blocking crawler access to duplicate content on your website, whether with a robots.txt file or other methods.”

      @Jacob – Justin is right about using Webmaster Tools to exclude parameters. You can also use rel=”canonical” to help Google figure out the best URL to use. SEO issues are indeed very relevant to web analysts these days.

    9. says

      @Jacob : SEO issue solved
      From Google Webmaster Tools (settings>parameters) you can ask Google to ignore url the url parmeter(s) used to differentiate internal campaign destination pages :-)

    10. says


      Question for you. Have you (or anyone else) figured out how to trace these internal ads back to ecommerce data. Some ecomm data shows in the ecomm tab, but it doesn’t allow you to drill down to the product level. Any thoughts?

      Much thanks, Porter

      • says

        @Porter – Great question. If you’re looking for actual product info try using an Advanced Segment based on the internal search term. Then apply the segment and use the Ecommerce > Product Overview report.

        Thanks for reading the blog!

    11. Sébastien Brodeur says

      Does the new uninteractive event tracking change the way we should track internal campaign? For example, this method only track click on ads but not impressions (I know, I know, I’m not a big fan of impression attribution model, but heck, marketing always dig that). Using two events (one for impression using a uninteractive event (to leave bounce rate alone) and another one for click? Thinking about it, why choose? We could use both methods (using event and search report) at the same time.

      • says

        @ Sébastien: Yes, you could absolutely use both methods. I agree that the best way to get impression data is with a non-interaction event. But I like using site search for clicks and activity because it requires almost no coding at all.

    12. says

      This is purely awesome! I don’t know how I’ve never thought of this before.
      I’m a big fan of using something “for an unintended purpose” :) especially in GA.

    13. Allen says

      This helps a lot – thanks Justin! What about if I am trying to track an “internal” banner campaign that is located on the separate domain of a parent organization, but the GA profiles are separate (i.e. there is no cross-domain tracking between the two)? I’m pretty confident we will be just fine to treat it like a regular banner campaign, but I am curious if I am overlooking something.

    14. says

      Hi Justin,

      Any idea why goals wouldn’t show up in a custom report tracking internal site search. I’ve set up a custom report with Total Unique Searches and the 2 Goals (Completions) as my metrics, with Search Term, and then Site Search Category as the dimensions, filtering out by including a Search Term (the icn). The Total Unique Searches figure shows up fine, but I get nothing in the goal completions (I’ve tried swapping out the Total Unique Searches for Unique Pageviews and Visits, but neither one shows any goal completions).

      I know that there have been some goal completions, and it gets even more baffling when I go to the goal completions overview, and create a Custom Advanced Segment to filter and only include the Search Term. When I do this, the goal completions for that icn show up.

      Any ideas where I’m going wrong?


    15. says


      Would you say this is all still applicable today, or are the better/other alternatives? Also, could you elaborate on how using external campaign parameters could mess up the source data? Lastly, would external campaigns parameters be more appropriate if you were tracking things across various sub-domains? With or without some sort of roll-up account?


      • says

        @Lee: Yes, I still think this is the best way. It involves the least amount of code, which in my eyes is the most important benefit.

        As to your other question, each time Google Analytics detects the campaign tracking parameters it starts a new visit. So, if you use the campaign parameters to track an internal campaign you’ll be terminating the visit that brought the visitor to your site and starting a new campaign.


    1. Tracking Internal Campaigns with Google Analytics…

      Internal campaigns are marketing efforts that are run on your site and promote your products and services. Here’s an example from the Boton Red Sox site. They’re using ads on the homepage to promote ticket sales….

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>