2

I want to track an ad campaign via a URL that will appear in a magazine.

I see how to generate the Google Analytics campaign tracking url as follows: https://example.com?utm_source=news4&utm_medium=email&utm_campaign=spring-summer

But I can't possibly publish that in the magazine article, nor can I expect someone to type that into a browser (accurately).

Is it possible to setup a server-side redirect or mod-rewrite using a more user friendly url and still capture the tracking data necessary in G.A?

If so, what is the best way to do this?

rmaddy
  • 314,917
  • 42
  • 532
  • 579

2 Answers2

0

Set up a special landing page. When somebody arrives at that page via direct type in (document.referrer is empty) set the campaign fields in your GA tracking code to your desired values (how to do that depends on the version of the GA code you are using).

For your exact example, where users seems to land directly on the homepage example.com, there is no real solution, since the homepage probably receives direct traffic that does not originate in your print campaign; you need a uniqur path for that.

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • Ok @EikePierstorff. I think I am following you. So I would hard code certain value in the script GATC in the heed section of such a landing page? I am using Universal Analytics BTW. Also using Google Tag Manager. –  Mar 28 '18 at 18:36
  • @Vic, if you are using GTM you can use the "set fields" option in GTM to set campaignMedium, campaignSource and campaignName respectively. If you want to tag only direct traffic you need custom variables that return your campaign info when document.referrer is not set, and undefined when it's set (undefined values will be ignored in the set set fields option), but arguably all traffic that goes to that page will be in one way or the other be caused by your campaign, so you could set the campaign values regardless. – Eike Pierstorff Mar 28 '18 at 19:29
0

I'd consider a couple of options:

  1. How about using a short URL? For example, example.com?utm_source=news4&utm_medium=email&utm_campaign=spring-summer becomes goo.gl/MVM51p, which could also be easy for users to type in.

  2. Create a new landing page, which JavaScript redirects to your campaign landing page. E.g. example.com/offer could redirect to example.com?utm_source=news4&utm_medium=email&utm_campaign=spring-summer

Sam Perry
  • 2,554
  • 3
  • 28
  • 29