Welcome to WebmasterWorld Guest from

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Tracking outbound links as part of a Google Analytics Campaign



9:49 am on Aug 17, 2011 (gmt 0)

10+ Year Member

Hi everyone,

How can one track outbound links as part of a Google Analytics campaign? I see it is possible for Goals.

I have added the code below to the Google Analytics script:

pageTracker._trackPageview('/Campaign Name/http://www.example.com/?src=icecream');

Can one use spaces in the above listed
Campaign Name

I have added
to have some form of control over the "inflated" page view stats, but not sure whether this is necessary.

How can one catch the following params:


Thanks in advance.


10:24 am on Aug 17, 2011 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member


Some people say it is bug but check this:

It looks like the very first space is converted to %2B, all other spaces on the same field are converted to %20.


11:44 am on Aug 17, 2011 (gmt 0)

10+ Year Member

Thank you, toplisek. I have used "%2B". I cannot currently access the Google Spreadsheet, but will check later. Thanks for the link.

Where will these stats be listed in Google Analytics and can it be added to a Campaign?


12:04 pm on Aug 17, 2011 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

As I understand all Google statistics is compliant. These means you can set Goal and this will be seen inside ALL tools. Set Goal and track (try).

Steps at the top tracked page (not landing):
1. Redirection


header("Location:http://www.mytrackedsite.html ");


2. Landing page and htaccess redirection
RewriteRule ^ads/([0-9]+)\.html$ ads/$mytrackedpage.php?utm_source=PCworld&utm_medium=cpm&utm_campaign=bing [L]


11:38 pm on Aug 17, 2011 (gmt 0)

So by "outbound links" do you mean incoming referrals from other sites to yours, or visitors exiting your site via links you have created?

If it's the first one, and you have control over the inbound link's URL structure you can use Google's URL builder to pass whatever params you want. Saying that, depending on how many links you are trying to track, this solution may not scale well, in which case I'd put together a script on your end to pick up the use of a generic param say yoursite.com/?referral and store the referrer data as a custom variable for later segmentation.

If it's the latter, I'd include an onclick event on outbound links to generate an Event.


11:04 am on Aug 23, 2011 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Check this sample.

Featured Threads

Hot Threads This Week

Hot Threads This Month