Monitor website traffic with Google Analytics tool

94. 利用Google Analytics工具监控网站流量

Use Google Analyticstools to help you track and analyze your website's traffic, user behavior, and other key metrics. Here are Google Analyticsthe steps to use:

1. Create Google Analyticsan account:

If you don't have Google Analyticsan account yet, please go to Google Analyticsthe official website ( https://analytics.google.com) and create a new account. Follow the instructions to provide the required information and set up your site properties.

  • I log in directly with Google Mail

Google Mail Login

  • After registering and logging in, click Start Measurement

start measuring

  • Create an account, customize the account name, and then click Next

Create an account

Next step

  • Create a media resource, customize the name, and click Next

Create a media resource

  • Select the industry, the number of employees, customize, and click Next

select industry

Next step

  • Select a business objective, customize, and click Create

Select business goals

  • Data Collection Selection Sites

data collection

  • Enter the website address, customize the website name, and click Create

Create data flow

  • Prompt that the collection function has not been turned on, you need to copy the code to the website, see the second page below

Click to view the code

2. Get the tracking code:

After creating your account, you will be given a tracking code. The tracking code is a piece JavaScriptof code that needs to be added to every page of your site in order to Google Analyticscommunicate with and track visitor data.

  • After the above steps, we can see that the tracking code is as follows

tracking code

3. Add the tracking code to your website:

Add the tracking code to every page of your website. The most common method is </head>to place the tracking code in <script>a tag before the closing tag on every page. </head>This can be done by locating the closing tag in each page's HTML file and adding the following code:

<head>省略...</head>
<script async src="https://www.googletagmanager.com/gtag/js?id=您的跟踪ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){
      
      dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '您的跟踪ID');
</script>

Make sure to replace the in the code '您的跟踪ID'with the actual tracking ID you got in Google Analytics.

  • You can also click the copy button to copy the tracking code directly

copy tracking code

4. Verify the tracking code:

After you've added the tracking code, you can use Google Analyticss real-time reporting feature to verify that your site is being successfully tracked. Visit your website and Google Analyticscheck the Real-Time Reports section in the Dashboard to verify that data about current visitors is displayed.

  • After adding the code, view the real-time report

View real-time reports

5. Explore and use Google Analytics reports:

After a period of waiting, Google Analyticsyour website data will be collected and analyzed. Log in to Google Analyticsthe Dashboard, and you'll be able to access a variety of reports and views of data, including visits, user behavior, conversion rates, and more. Explore the various reports and perform data analysis according to your needs to gain deep insights into your website performance.

  • You can explore different functions according to your needs

explore

The above are Google Analyticsthe basic steps to use the tool. As your familiarity and needs grow, you can further explore and take advantage of the Google Analyticsmore advanced features and reports available for more accurate and detailed data analysis.

Guess you like

Origin blog.csdn.net/weixin_42560424/article/details/131430035