I have one old domain that points to a website's server's ip (let's call it www.oldsite.com). I have a new one, www.newsite.com, that is set up to be forwarded to a specific page on the website. Due to the way the host of newsite.com places the website in a frame, in Google Analystics, the newsite.com is listed as a source rather than the source they were at before hand, causing a self referral. A solution is to edit the code of the iframe as I looked up, but there's no way to really edit the host's masking source code of course.

Another solution I did previously was have www.newsite.com point to the address that www.oldsite.come pointed to. It solved the analytics problems, but in exchange, the url masking no longer worked. In the address bar, it came up as www.oldsite.com.

Is there a way to make me have url masking and be able to forward to agree with google analytics? The server of the website is hosted on a cloud server, if this is anymore information.

  • Do you have the possibility of adding an htaccess an any kind of php file? If I get you right you basically want to move your site from one domain name to another, right? Jun 29, 2014 at 5:16
  • Do you have GA universal ? If yes, have you tried referral exclusions ? Nov 16, 2016 at 7:58

3 Answers 3


If I understand it correctly, you want all the traffic from both domains being showed in Analytics only by www.newdomain.com right?

Never did before but, I think you can try something like this:

  1. Apply an Advanced filter to add the hostname to Google Analytics.
  2. Apply a Search and Replace filter to change olddomain.com to newdomain.com

There are other actions needed to be implemented in order to register data properly.

  1. You have to set cookieDomain to 'none' (cause you are using two domains).
  2. You should use the iframe implementation (to keep record of origin source and users).

There may be a way to accomplish what you are looking for using domain masking, but I would strongly recommend against it. Domain masking does not mix with SEO. Domain masking itself is an ugly hack that hosting companies at some point started calling a feature, and it prevents search engines from properly reasoning about a page.

I would direct all your attention towards getting your website setup working without domain masking. This could involve 301 redirects, request proxying, or old fashioned moving the files to a new server. By doing so, you will be solving not only this one issue but other issues that are likely to pop up due to the domain masking.


You would need to serve this content from the new domain name:

  • copy the content
  • change the Google Analytics tracking snippet in it
  • point the new domain at it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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