1

I'm tried to host a static Jekyll based website (sort of blog) with an S3 bucket and redirecting my domain name to the bucket (using a mask by now, but am considering define CNAME for it).

Anyway, I created my website's prototype and tested it via the jekyll serve command and everything is working fine, Google analytics show almost immediately that I have a visitor.

After that, I uploaded the page using s3_website and everything, but Google Analytics, seems to be working fine. I googled it and it looks like I'm not the only one with this problem.

Some solutions I tried out: I checked the whole GA code to see if it's correct (and it is otherwise it would work locally), I turned the whole bucket public, tried going to the link directly, and can't figure it out...

What else should I try to get this working?

CMPSoares
  • 4,175
  • 3
  • 24
  • 42
  • 1
    try the cname approach - that seems to make sense... – pherris May 19 '14 at 19:59
  • Ok I'll come back to you later, don't understand why that does make sense, I think it might have something to do with the S3 settings but I'll let you know... – CMPSoares May 19 '14 at 23:01
  • 1
    I was thinking that Google may not respect the data coming from your site if the actual URL is different from the URL configured in the GA settings. I'm assuming that you are validating within the real time section of GA (since many of the other metrics lag behind a bit). – pherris May 20 '14 at 12:05
  • 1
    Well yes that's what I'm doing but when I use a local host it works and that's certainly different from the GA settings... And the url I use is the same, it masks at this moment another one, but I found something that makes sense and goes in the same direction you're using, I'll be giving feedback soon. – CMPSoares May 20 '14 at 16:38

1 Answers1

1

I figured out what was happening, I hadn't configured correctly my domain according to the following SO posts: how do i to forward domain.com to www.domain.com at godaddy for s3 hosted site? and Using GoDaddy Domain Hosting to link to Amazon S3 Website.

Well what seemed to be happening is that when I masked my domain the GA code wasn't able to contact the serve, probably it got blocked by the DNS to stay masked.

So I configured a domain forwarding for the domain without "www" to the full domain with "www" and configured the CNAME for the "www" subdomain to the link of my bucket without its name (i.e. s3-website-us-east-1.amazonaws.com) and created a bucket with the same name as my domain and it started working perfectly.

So nothing was actually wrong with the code, just that Google Analytics doesn't work with masked domains.

Community
  • 1
  • 1
CMPSoares
  • 4,175
  • 3
  • 24
  • 42