Google analytics for custom domain

snavysnavy Registered Users Posts: 27 Big grins
edited August 28, 2009 in SmugMug Support
I just got a custom domain (dtourphotography.com) which I am using instead of the normal navyn.smugmug.com address. I had google analytics setup on the original page so my question is, how do I set it up to track the visits that come through the new site address? Right now it says "tracking not installed" for dtourphotography.com Do I just put the new code in the footer and delete the old one or do I need to keep both codes in there for both address? Do I need to track both sites?
Planning is good, but life is better.
Embrace the dtours.
www.dtourphotography.com

Comments

  • snavysnavy Registered Users Posts: 27 Big grins
    edited February 20, 2009
    bump

    anyone?
    Planning is good, but life is better.
    Embrace the dtours.
    www.dtourphotography.com
  • docwalkerdocwalker Registered Users Posts: 1,867 SmugMug Employee
    edited February 20, 2009
    I run 2 versions of the GA code on my site with no problems. One is for the yournickname.smugmug.com version of your URL and one is for the custom domain. It works.

    thumb.gif
    SmugMug Support Hero
    http://help.smugmug.com
  • timnosenzotimnosenzo Registered Users Posts: 405 Major grins
    edited February 20, 2009
    I have my Google Analytics code set up for my custom domain, then I have this JS Redirect on my site:

    http://www.dgrin.com/showthread.php?p=402384

    So if someone types in http://timnosenzophoto.smugmug.com, if forwards them to http://www.timnosenzophoto.com. This way all of the tracking is connected to the one domain. mwink.gif
  • docwalkerdocwalker Registered Users Posts: 1,867 SmugMug Employee
    edited February 20, 2009
    The only downside of the JS hack is that if your domain should go down for some reason, you will be locked out of your site.

    A support hero can remove the hack if that happens.

    Domains do go down occasionally for various reasons. We see it from time to time on the help desk. Customers write in that both the custom domain and the smugmug URL to their sites is down. Almost always, this is related to the domain being down and the JS hack.

    I just want you to understand the downsides, I am not saying that you should not use it.
    SmugMug Support Hero
    http://help.smugmug.com
  • snavysnavy Registered Users Posts: 27 Big grins
    edited February 21, 2009
    thanks for the help guys! i just put both google codes, it wasn't working at first but now it is.
    Planning is good, but life is better.
    Embrace the dtours.
    www.dtourphotography.com
  • GSPePGSPeP Registered Users Posts: 4,013 Major grins
    edited February 24, 2009
    Is it really necessary to put 2 Google codes on one site?

    Doesn't Google Analytics register everything that comes to the site? Even if it's through the "name.smugmug.com" link or the custom domain name.

    If I access my site via the smugmug link I see Google Analytics working on the status line of the Firefox browser. It does the same when I access via the custom domain name.

    Was just wondering headscratch.gif
  • denisegoldbergdenisegoldberg Administrators Posts: 14,408 moderator
    edited February 24, 2009
    GSPeP wrote:
    Is it really necessary to put 2 Google codes on one site?

    Doesn't Google Analytics register everything that comes to the site? Even if it's through the "name.smugmug.com" link or the custom domain name.

    If I access my site via the smugmug link I see Google Analytics working on the status line of the Firefox browser. It does the same when I access via the custom domain name.
    I was curious too, so I registered for a second analytics code (I already was using a code for my smug url). With two sets of Google Analytics code on the same site (my smug URL + my custom domain), I saw duplicated results in my analytics reports, same numbers, one for each domain. So I removed the second set of analytics code.

    Based on my experience, I would say that putting 2 google analytics code snippets on one site does not show you anything different from using a single set of analytics code.

    --- Denise
  • docwalkerdocwalker Registered Users Posts: 1,867 SmugMug Employee
    edited February 24, 2009
    It was necessary for me and I see 2 different sets of results for my URLS. YMMV thumb.gif Statcounter seems a bit smarter about it.
    SmugMug Support Hero
    http://help.smugmug.com
  • denisegoldbergdenisegoldberg Administrators Posts: 14,408 moderator
    edited February 24, 2009
    docwalker wrote:
    It was necessary for me and I see 2 different sets of results for my URLS. YMMV thumb.gif Statcounter seems a bit smarter about it.
    Very interesting. Did you pick up something other than the standard analytics code? I pulled the only code that appeared to be available and put it in my footer. Left it for a few days, and saw identical results on the two urls. I wonder what caused the different reactions on our sites.

    --- Denise
  • docwalkerdocwalker Registered Users Posts: 1,867 SmugMug Employee
    edited February 24, 2009
    Here is what I see using both codes. I was only getting the yournickname.smugmug.com one until I added the custom domain. Maybe they have changed things?

    479909963_EFBeQ-L.jpg
    SmugMug Support Hero
    http://help.smugmug.com
  • denisegoldbergdenisegoldberg Administrators Posts: 14,408 moderator
    edited February 24, 2009
    docwalker wrote:
    Here is what I see using both codes. I was only getting the yournickname.smugmug.com one until I added the custom domain. Maybe they have changed things?

    479909963_EFBeQ-M.jpg
    When I added the custom domain, I saw two entries on my analytics screen. Problem is, the two domain entries (my smug url & my custom domain) showed the same numbers once I drilled into the details. When I first added the entry for the custom domain I saw different numbers, but I believe that was because of the time of day that it was added (in that there were already numbers for my smug domain). I watched for a couple of days and continued to see the same number on both domains.

    As I squint at your report, it looks like you are definitely seeing different nmbers for the two domains. Interesting...

    --- Denise
  • docwalkerdocwalker Registered Users Posts: 1,867 SmugMug Employee
    edited February 24, 2009
    Sorry, I was trying to keep the file size down. I made it bigger :-)

    So, yes that is the same thing I did. When I saw no traffic on the custom domain, I added the second code. Then I saw numbers and the numbers are different.

    What is interesting is that the reports page shows relative links. So the domain should not matter. But the numbers, and the list of links visited are not the same and have been that way from the start.

    I will continue to use both as it seems to work best for me that way. You might try it.
    SmugMug Support Hero
    http://help.smugmug.com
  • GSPePGSPeP Registered Users Posts: 4,013 Major grins
    edited February 25, 2009
    Problem is, the two domain entries (my smug url & my custom domain) showed the same numbers once I drilled into the details.
    That is what I would have expected.

    What I do see on Google Analytics is, that in the list of "sources", the custom domain name is shown when people visit the site using that link.

    I could always try to put in the second Analytics code to see what happens. I'll let you know if the nummers are the same or not.
  • GSPePGSPeP Registered Users Posts: 4,013 Major grins
    edited March 3, 2009
    Had both codes run for a five day period on my site:

    steendorp.smugmug.com - www.steendorp.info

    Almost no differences in following points:
    - Visits: 350 - 353
    - Unique visitors: 271 - 271

    But then it starts:
    - Page views: 1744 - 25052 headscratch.gif

    When I look at "sources", "search words", "countries", ..., the numbers are the same. Only the "pages" that visitors went to are different.

    After checking, I saw that there was a slight difference in the Analytics code. Both are "ga.js", but the code in steendorp.smugmug.com is one year old. I copied the 'newer' code in both and will keep track of it. Probably more news here in 4 to 5 days.
  • eric239eric239 Registered Users Posts: 2 Beginner grinner
    edited August 28, 2009
    docwalker wrote:
    I run 2 versions of the GA code on my site with no problems. One is for the yournickname.smugmug.com version of your URL and one is for the custom domain. It works.

    thumb.gif
    A slight variation to this approach is modifying GA's javascript to use one tracker ID or the other based on the effective host, something like this (this example is for the new version of GA code but of course something similar will work for urchin just as well)
    var pageTracker = _gat._getTracker("your-custom-host" == window.location.hostname ? "tracker-for-custom" : "tracker-for-smugmug-alias");
    
    The [small] advantage is that there will be only one request sent, so it might slightly (or more than slightly if GA is slow/down) improve page load time.
Sign In or Register to comment.