Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Discussions > Tracking Your Site > How to track 301 redirect website
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
flysaa  
View profile  
 More options Nov 5 2007, 9:54 am
From: flysaa
Date: Mon, 05 Nov 2007 14:54:39 -0000
Local: Mon, Nov 5 2007 9:54 am
Subject: How to track 301 redirect website
I have following php code on a website of ours that we direct
customers from offline promotions to which I would like to include in
the tracking:

<?php
header("HTTP/1.1 301 Moved Permanently");
header('Location: http://ww3.flysaa.com/de/reservation/de_resmultilegsearch_content.htm...
exit();
?>

How can I have Google Analytics tracking for this site?

I tried following code but do not seem to get any data:

<?php
header("HTTP/1.1 301 Moved Permanently");
header('Location: http://ww3.flysaa.com/de/reservation/de_resmultilegsearch_content.htm...
$virtual_page = "Pressemitteilung_November";
include_once("analyticstracking.php");
exit();
?>

Thanks for your help.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Nov 5 2007, 1:11 pm
From: ShoreTel
Date: Mon, 05 Nov 2007 10:11:43 -0800
Local: Mon, Nov 5 2007 1:11 pm
Subject: Re: How to track 301 redirect website
You can't.

A redirect forces the browser to go to a different URL without
rendering a page. No page, then no javascript. No javascript, then no
tracking.

On Nov 5, 6:54 am, flysaa wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
suntrop  
View profile  
 More options Nov 6 2007, 4:51 am
From: suntrop
Date: Tue, 06 Nov 2007 09:51:47 -0000
Local: Tues, Nov 6 2007 4:51 am
Subject: Re: How to track 301 redirect website
Isn't it possible to add some javascript to the redirect URL?
Or is this not working with js only php? Otherwise he could add a
variable or a segment and filter it in GA.

On Nov 5, 7:11 pm, ShoreTel wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Nov 6 2007, 3:51 pm
From: ShoreTel
Date: Tue, 06 Nov 2007 12:51:16 -0800
Local: Tues, Nov 6 2007 3:51 pm
Subject: Re: How to track 301 redirect website
If the redirect is server-side (ie. a 301, 302, or a "Location: "
header) there is no page rendered in the browser.

If you use META refresh, or JavaScript to do the redirect you can,
because the redirect is being done by the page instead of the server.

On Nov 6, 1:51 am, suntrop wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
suntrop  
View profile  
 More options Nov 7 2007, 5:24 am
From: suntrop
Date: Wed, 07 Nov 2007 10:24:48 -0000
Local: Wed, Nov 7 2007 5:24 am
Subject: Re: How to track 301 redirect website
I guess I doesn't expressed well.

What I wanted to say is...

<?php
header('Location: mypage.php?redirect=301');
?>

In mypage.php he can check if the user was redirected and apply the JS
code.

<?php
if (!empty($_GET['redirect']))
{

  switch ($_GET['redirect'])
  {
    case 301:
      $attach_code = 301;
      break;
    case 302:
      $attach_code = 302;
      break;
    case 404:
      $attach_code = 404;
      break;
    default:
      $attach_code = 200;
   }

}

?>

So he doesn't have to track the redirect page but instead he can track
if the user comes from a redirected page. The $attach_code could
insert a new segment for example. It is a more backwards directed
tracking.

But maybe it is just nonsense what I wrote :-) I am new to GA as well.

On Nov 6, 9:51 pm, ShoreTel wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Nov 7 2007, 2:10 pm
From: ShoreTel
Date: Wed, 07 Nov 2007 11:10:01 -0800
Local: Wed, Nov 7 2007 2:10 pm
Subject: Re: How to track 301 redirect website
If you add "utm" tags to the URL when you do the redirect on the
server side you can control source, campaign and medium that way.

For Example:
www.domain.com/shortURL ->

header("Location: /directory/newfile.html?
utm_source=mysource&utm_medium=print&utm_campaign=mycampaign", FALSE);

On Nov 7, 2:24 am, suntrop wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »