2

Showing UTMs when linking from one site you own to another is kind of like wearing open-toed shoes at work: it's unseemly and unprofessional.

But it's effective. Traffic spills nicely into Google Analytics with each parameter (source, medium, campaign, content) easily sortable & filterable in a single view.

I assume there is another way to do this: to somehow obfuscate the campaign parameters so that Google Analytics reads, ie:

http://foo.com/fudge?=xyz

as

http://foo.com/fudge?utm_source=sitex.com&utm_medium=social&utm_campaign=social-explosion

Can this be done in the GA admin panel? Is there another way?

3

It can't be done in the Google Analytics admin panel, but it can be done programmatically by your server.

You can put some extra JavaScript in your snippet to send Analytics the full campaign info based on your shortened form. Here is how it might look if you use PHP with Universal analytics:

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
<?php if($_SERVER['QUERY_STRING'] == "=xyz"){ ?>
    ga('set',{
        campaignName:'social-explosion',
        campaignSource:'sitex.com',
        campaignMedium:'social',
        campaignKeyword:'blue widgets',
        campaignContent:'320x480 ad'
    });
<?php } ?>
ga('create'...
ga('send', 'pageview'...

Documentation:

  • I was afraid this might be the only way to do it. Thanks for the wisdom. If any other methods of come to mind plz lemme know! – samthebrand Sep 12 '14 at 14:21
0

@Stephen Ostermiller 's answer is correct. If I could suggest something that might make things a little easier. Using Google Tag Manager you can automate the process and it will also give you more flexibility. Check out this article on UTM Campaign Parameters from LunaMetrics. This will save you a lot of time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.