Add a buried point on the homepage of the official website

Generally, there are Baidu, Google, or write a js method by yourself. All three methods can be used.

1: Use google's method here. Just add a piece of js code to the page that needs statistics:

But what needs to be noted here is that the id of G-YHH0XJ4KJ7 requires the user to apply for Google, the account password,

You can view the search log after logging in to the google background

<script async src="https://www.googletagmanager.com/gtag/js?id=G-YHH0XJ4KJ7"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag() { dataLayer.push(arguments); }
        gtag('js', new Date());

        gtag('config', 'G-YHH0XJ4KJ7');
    </script>

2: Baidu's comparison pit, after adding buried points, spam advertisements will often appear on the page. Need to pay to disappear. So give up later

3: Write a js by yourself. The js method uses function() {} to refresh the page to trigger the method of calling the controller, and save the log in redis, and then read the log in redis through the service and save it.

Guess you like

Origin blog.csdn.net/xulong5000/article/details/112860574