- From your main Google Analytics screen, click “Add Website Profile” at the bottom of the screen.
- If this is the first repository you’ve setup, select the option to add a profile for a new domain. Once you’ve done this for one of your repositories you can use the existing domain option.
- In the URL field, enter “http://bitbucket.org”.it won’t let you enter the full URL of your repository here.
- Click “Finish”, which should take you back to the main Google Analytics screen.
- Find your analytics key for Bitbucket (i.e. UA-123456-7) and copy it.
- Go to the “Admin” page of your repository and paste the analytics key in the appropriate field.
- Head back to Google Analytics and click “Edit” on your newly created profile to bring up its settings.
- Under the “Main Website Profile” click “Edit” and paste the full URL of the repository in the “Website URL” field.
- It might take a few minutes, but the status of the tracking code should change from “Tracking Unknown” to “Waiting for Data”, and eventually to “Receiving Data”.
Now you are able to have some valuable insight into traffic reaching your repositories!