Rails + Google Analytics
I want to ask some question about using Rails (2.1.0) and Ruby (1.8.7).
I have development mode and production. 开发者_如何学CProduction mode has a domain (for example blabla.online.com
), development mode has an ip adress (for example 199.199.199.199
).
QUESTION: Do I need to create two different accounts in analytics (one for development and one for production)?
You don't want multiple "Accounts", but you do want multiple "Website Profiles".
- Login to Google Analytics, you should be on a page with title "Overview: all accounts"
- Click on the link for the correct account (in your example it's probably called "online").
- You should now be on a page with title "Overview >> online" that shows a list of all website profiles associated with this account.
- At the bottom of the table click "Add website profile"
Note that your new website profile will have a different tracking ID (e.g. the thing that looks like UA-255235386-2
) so you'll need to have an environment specific configuration in your Rails app to use the appropriate tracking ID for the appropriate environment.
精彩评论