This article was co-authored by Mitch Harris. Mitch Harris is a Consumer Technology Expert based in the San Francisco Bay Area. Mitch runs his own IT Consulting company called Mitch the Geek, helping individuals and businesses with home office technology, data security, remote support, and cybersecurity compliance. Mitch earned a BS in Psychology, English, and Physics and graduated Cum Laude from Northern Arizona University.
This article has been viewed 43,823 times.
You’ve got a fancy new website for your business up and running, and all that’s left is to rake in the money, right? Before you start seeing cash, you’re going to want to make sure that your page is getting the traffic it needs. That’s where Google Analytics comes in. By inserting the Analytics code into your website or app, you’ll be able to track all of the traffic that it gets. This will help you make sure that visitors are getting the best experience possible.
Steps
Creating Your Accounts
-
1Visit the Google Analytics website. Open google.com/analytics/ in your browser. Click the “Access Analytics” button at the top-right corner of the site. This will take you to a new page that shows a brief rundown of how Analytics works. Click the “Sign up” button to create your Analytics account.
- You will need to sign in with your Google account if you are not already.
- You can create a new Google account specifically for tracking your Analytics data if you want to keep it separate from your personal Google account.
- You can add the code it offers to the web pages you wish to track.
-
2Select between "Website" or "Mobile app" tracking. Use the buttons at the top of the page to switch between website tracking or mobile app tracking.Advertisement
-
3Enter your account information. In order to create your Analytics account, you will need to provide some basic information to Google. This will help determine how the Analytics data is interpreted and returned to you.
- Enter an account name. This will be the account that manages various properties that you track. You can track up to 25 properties per account, and can have 100 accounts per Google account.
- Enter your website name and URL or app name in the “Setting up your property” section.
- Select the Industry that best fits your website, and select the timezone that you want your reporting to take place in.
-
4Select your data sharing options. There are four data sharing options you can choose to enable or disable. These allow your Analytics data to be shared with other Google programs such as AdSense, anonymously with Google for statistical reasons, and with account specialists for troubleshooting and optimization of your Analytics account.
-
5Create the account. You'll be taken to the Admin page where you can find the Tracking ID for your website or mobile app.
-
6Visit the Google Tag Manager website. This is a new tool from Google that makes implementing and changing analytics tags much easier across all of your sites and apps. Tag Manager is free, and you can sign up with your Google account at google.com/tagmanager/.
-
7Create an account and add a container. The container will hold all of the tags you want on the site, including Analytics, AdWords, and any third-party tags. The container name should be your website URL or app name.
- Select the type of container you need (Web, iOS, Android). Click the "Create" button.
- Click here if you're inserting the tag in a website.
- Click here if you're inserting the tag in a mobile app.
Inserting Tags in Websites
-
1Copy the tag that's displayed when creating your container. This tag will need to be inserted on every web page that you intend to track.
-
2Open each webpage's source code. If you don’t have access to your site’s code, get in touch with your web developer. You will need to be able to edit the code in order to insert the tag.
-
3Paste the copied code directly beneath the opening <body> tag. Re-upload the updated file and repeat for every page on your site. This will enable the Tag Manager to insert the tags you want onto each of your web pages.
-
4Click the "Add a new tag" link on your container's configuration page. You can find this page after you close the window displaying the Google Tags code snippet.
-
5Select "Google Analytics" from the list of Products. Select "Universal Analytics" and click "Continue".
-
6Copy and paste the Tracking ID from your Google Analytics Admin page. Select the type of tracking you want to monitor from the drop-down menu.
- Page View is the most common, and simply tracks when someone has visited the page. You can also choose from a variety of other types, including events, transactions, social media clicks, and more.
-
7Select a trigger for the tag. For the Page View tag, select "All Pages". You can select "Some Pages" if there are certain pages you don't want tracked. You can also choose from other, more-specific triggers.
-
8Save the tag. Review your tag settings and click the "Save Tag" button. You'll see your new tag in the list.
-
9Publish the new tags. Click the "Publish" button and then review the information displayed. Click "Publish Now" to send the tag to the website and activate it.
-
10Start monitoring your results. After about 24 hours, you should start receiving analytic reports. Click here for details on reading your reports.
Inserting Tags in Mobile Apps
-
1Install your development tools. In order to enable Google Tag Manager in your Android app, you'll need to add it to your app's source code. Discuss this with your app developer if you don't have access to your app's code. You'll need the following tools to add the code to your app:
- Android SDK
- Google Play Services SDK
- If you want to implement the tag in an iOS app, click here for detailed instructions.
-
2Add the permissions to the AndroidManifest.xml file. Open the file and add the following code into the permissions area:
<!-- For TagManager SDK --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-
3Return to the Google Tab Manager page. Click the "Add a new tag" link in your container's admin page.
-
4Select "Google Analytics" from the list of Products. Select "Universal Analytics" and click "Continue".
-
5Copy and paste the Tracking ID from your Google Analytics Admin page. Select the type of tracking you want to monitor from the drop-down menu.
- App View is the most basic option which will tell you every time someone opens the app.
-
6Save the tag and publish it. This will enable you to download the container binary to add to your app.
-
7Click the Versions tab at the top of the Tag Manager page. You'll see a list of your tag versions.
-
8Click the "Actions" button next to your first version and select "Download". This will download a small file to your computer.
-
9Create a raw resource folder in your project. The path should be <project-root>/res/raw. Rename your downloaded file to remove any upper-case characters and then copy it to the /raw/ folder.
-
10Create a new public class to extend Object. This is where you will implement the Google Tab Manager code.
-
11Enter in the Google Tab Manager code. Enter the following code to implement your tag. Replace containerId with the ID of your container, and container_file with the filename of your container binary file:
TagManager tagManager = TagManager.getInstance(this); PendingResult<ContainerHolder> pending = tagManager.loadContainerPreferNonDefault(containerId, R.raw.container_file); pending.setResultCallback(new ResultCallback<ContainerHolder>() { @Override public void onResult(ContainerHolder containerHolder) { ContainerHolderSingleton.setContainerHolder(containerHolder); Container container = containerHolder.getContainer(); if (!containerHolder.getStatus().isSuccess()) { Log.e("AppName", "failure loading container"); displayErrorToUser(R.string.load_error); return; } ContainerHolderSingleton.setContainerHolder(containerHolder); ContainerLoadedCallback.registerCallbacksForContainer(container); containerHolder.setContainerAvailableListener(new ContainerLoadedCallback()); startMainActivity(); } }, 2, TimeUnit.SECONDS);
-
12Publish your updated app. The above changes will report any time someone performs an event in your app. Since your tag is set to fire on any event, you won't need to include any more code to activate the tag. If you wanted tags to only fire on specific events, you'll need to add additional code Click here for details on reading your reports.
- Click here for more detailed instructions on implementing Google Tags.
-
13Start monitoring your results. After about 24 hours, you should start receiving analytic reports. You can find your analytic information from the Google Analytics website. See the next section for information on reading your reports.
Monitoring Your Results
-
1Open the Reporting section of the Google Analytics site. This will load the "Overview" page of the Behavior section, which will show you some basic information about the number of views you're getting. You can see how long visitors are staying on the page, the percentage that are bouncing off, and the percentage that are exiting.
-
2Open your Dashboard. You can view the Dashboard for each of your tracked sites by using the Dashboards menu on the left side of the site. Dashboards allow you to see in-depth information about the traffic for your site.
-
3Customize your Dashboards. Each Dashboard comes pre-configured with basic widgets. You can customize them to better suit the needs of your site and business. Click the “+Add Widget” button in the Dashboards menu to add new widgets to the Dashboard. You can also remove any widgets that are already active.
-
4Create more Dashboards. You can create new Dashboards to monitor specific aspects of a site. You can create up to 20 Dashboards. To create a new Dashboard, click the Dashboard menu and then click “+New Dashboard”
- Starter Dashboard contains all of the basic widgets.
- Blank Canvas contains no widgets.
-
5Use Filters to limit traffic that is displayed. If you have a lot of traffic coming from employees, you can use Filters to hide the traffic they generate. You can also use filters to only show traffic to a specific subdirectory, or hide traffic from that subdirectory.
Setting Goals
-
1Return to the "Admin" section of the website. Select the account under which you would like to set up goals. This is under the "Views" tab. As you add more websites to your account, you will see a list of account names in this area.
-
2Click the Goals button in the left menu. Select “Create a Goal” to start defining a new goal for your view, and then give your goal a name.
- Make sure to check the “Active” box to have the goal start tracking immediately.
-
3Choose the type of goal you would like to create. There are templates available depending on the Industry you selected for your website when you created your Tracking Code.
- Choose "Destination" as the goal if you want to get a certain amount of visits to a specific URL.
- Choose "Pages per Visit" or "Screens per Visit" to specify a certain number of pages that your users visit while they are there. Specify a "Condition" and a number of pages visited. These are sometimes called "Readers."
- Choose "Duration" to work toward a certain visit length. Fill in the time in minutes or seconds. Then, enter the goal value. You may refer to these visitors as "Engaged Users."
- Choose an "Event" goal for a "Call to Action," such as buying a ticket or submitting an RSVP. You will need to return and fill out this goal once you have activated the Analytics Goal Tracking feature.
- Choose “Sales” or other e-commerce goals to track the number of people that buy and what they choose to buy.
-
4Save your new goal. Select "Save" when you have specified all the details for your goal. You can create up to 20 goals per view.
-
5Read your Goal Flow Report. This report will give you information on how visitors are reaching your goal. It is located under Standard Reporting > Conversions/Outcomes > Goals.
- You can see where visitors are entering your funnel to your goal, where they are exiting if they are leaving too soon, where the traffic loops back, and more.[1]
Activating Additional Analytics Features
-
1Track email, social media and other marketing campaigns with Google Analytics. Build a custom URL that tracks traffic for each new campaign.
- Go to the Campaigns URL Builder to build your URL with the website, source, medium, term, name and content. Use this custom URL on any online links. Google will track the user's information.
- Go to the "Campaigns" tab. Select "Traffic Sources" and proceed to "Sources" to analyze your specific campaigns for their success.
-
2Setup linked accounts with Google AdWords. If you have a Pay Per Click (PPC) account, link this to Analytics so that you can track conversion rates and run reports on each PPC ad.
-
3Use Event Tracking. Similar to a custom URL for campaigns, customize your event links to track the source and conversion for ticket purchases.
- Add specific details about your event in the latter half of the URL, including them in the following order: event, category, action and label. Search for the "Event Tracking Guide" to find specifics on how to set up this slightly technical URL. Go to the "Reports" section to track your event movements.
About This Article
1. Go to https://www.google.com/analytics.
2. Create an account.
3. Go to https://google.com/tagmanager.
4. Create a container for your website.
5. Add the tag from the Tag Manager to the site.
6. Monitor the results after 24 hours.