1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need simple html coding

Discussion in 'Hire a Freelancer' started by cousty, Oct 20, 2015.

  1. cousty

    cousty Newbie

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    6
    Sorry, I don't have the time to learn how to do this.

    I have a domain that redirects to another domain. I have it redirected at the host (Bluehost.com) as a 301 permanent redirect. I can't track my traffic sources when I have my Google Analytics attached only to my final domain. I'm thinking i need to remove the 301 redirect, and create a home page that redirects to the other domain, but attach my GA code to it so I can track the source of the traffic.

    Thoughts? Is this a good idea? Can someone help?
     
  2. Conor

    Conor Elite Member

    Joined:
    Nov 7, 2012
    Messages:
    3,577
    Likes Received:
    5,954
    Gender:
    Male
    Location:
    South Africa
    Home Page:
    Give this a read: http://www.lanevance.com/web/web-development/tracking-301-redirects-with-google-analytics/
     
    • Thanks Thanks x 1
  3. blackmint

    blackmint Power Member

    Joined:
    Jun 8, 2013
    Messages:
    655
    Likes Received:
    340
    Location:
    BHW
    Hope this simple redirect helps...

    Code:
    <html>
      <head>
        <title>Redirecting... Please Wait...</title>
        <META http-equiv="refresh" content="10;URL=http://www.google.com">
      <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-YOUR ANALYTICS ID']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>
      </head>
      <body>
        <center>Redirecting you to new Website in 10 seconds...
        </center>
    
    
      </body>
    </html>