Sedang Disiapkan

Tracking Alias in Google Analytics by Server Virtualhost

I have a URL alias. Google Analytics suggests that I do the following for accurate data:

How do I track a site that uses domain aliases?

The following instructions provide an example of how to redirect aliased domains to the primary domain in Apache and IIS servers. These steps will ensure that the Analytics visitor tracking is getting set under the primary domain and that all visitors are tracked consistently.

Redirecting Aliases in Apache

If you are using an Apache webserver, the configuration can be easily modified to redirect all traffic originating under one of the aliases to the primary site. One way to do this is to create two VirtualHost entries. The first will be the primary domain which will include your normal configuration; the second VirtualHost will be for all the aliases and will redirect to the primary:

#---primary virtualhost

Servername [url removed, login to view]

Serveralias [url removed, login to view]

...

#---second virtualhost

Servername [url removed, login to view]

Serveralias [url removed, login to view] [url removed, login to view] [url removed, login to view]

RewriteEngine on

RewriteRule ^(.*) [url removed, login to view]$1 [R=301]

The second VirtualHost uses a rewrite rule with a 301 (Moved Permanently) redirect code to forward all traffic to the original site. At this point, as far as Google Analytics is concerned, the site appears to be a one-domain site and is ready for normal Analytics tracking code installation.

Redirecting Aliases in IIS

If you are using a Microsoft IIS webserver, the configuration can be easily modified to redirect all traffic originating under one of the aliases to the primary site. One way to do this is to create two websites in the IIS configuration. The first will be the primary domain ([url removed, login to view]) which will include your normal configuration; the second will be for all other aliases ([url removed, login to view], [url removed, login to view], etc.) and will redirect to the primary.

To create a 301 redirect using IIS, follow these steps:

Log in as an Administrator and open the Internet Services Manager by going to Start >> Programs >> Administrative Tools >> Internet Services Manager.

Choose the server which is hosting your primary domain.

In the folder, click the primary domain with your right mouse button and select Properties.

Click the 'Home Directory' tab.

In the "Redirect to:" field, enter the domain you want to redirect to. For example, if you want to redirect to [url removed, login to view], enter [url removed, login to view] in this field.

Under the "The Client will be sent to" section, select "A permanent redirection for this resource." This will create a 301 redirect from your primary domain to mysite.org.

If you want to use a 302 redirect instead, just uncheck the "A permanent redirection for this resource" option.

If you want to pass on the variables from the primary domain to the new domain you are redirecting to, add the domain and $S$Q in the "Redirect to:" field, e.g. [url removed, login to view]$S$Q. Please note that you do not need to add a trailing slash after the domain.

$S is used by IIS to replace the subdirectory location, and $Q is used for any query string that is appended at the end. So, if your main URL is [url removed, login to view], it will redirect to [url removed, login to view]

While using the $S$Q feature, ensure that both "The exact URL entered above" and "A permanent redirection for this resource" options under the "The Client will be sent to" section are selected.

Can anyone help me?

Kemahiran: Pemasaran Internet, Reka Bentuk Laman Web

Lihat lebih lanjut: tracking alias, primary site alias, virtual host google, apache track server aliases, website promotion tools, web manager google, steps start web design, steps create website, server domain, promotion internet, programs design websites, programs create websites, primary services, net configuration manager, location services google, in sent, create website internet, choose web design, home instead, google design web, google create site

Tentang Majikan:
( 2 ulasan ) Irvine, United States

ID Projek: #375586

Dianugerahkan kepada:

MikeRogers

I can do this for you. US Provider.

$200 USD dalam 2 hari
(3 Ulasan)
3.1

2 pekerja bebas membida secara purata $225 untuk pekerjaan ini

mmoailek

Ok let's do it. I'm ready to help you.

$250 USD dalam 2 hari
(0 Ulasan)
0.0