简体   繁体   English

Google跟踪代码管理器和Google Analytics(分析)跟踪

[英]Google Tag Manager and Google Analytics tracking

I have configured GTM and GA on my website. 我已经在网站上配置了GTM和GA。 I installed GTM Assitant (chrome extension) to try and it works perfectly. 我安装了GTM助手(chrome扩展程序)进行尝试,并且效果很好。

When I check GA Real Time event, my GTM is returned. 当我检查GA实时事件时,会返回我的GTM。

My question is : Someone know if I can track click count by week, month, year like page view ? 我的问题是:有人知道我是否可以按页面浏览量按周,月,年跟踪点击次数?

Thanks. 谢谢。

EDIT : 编辑:

<div class="phone">
    <a href="#" onclick="gaEvent()" title="voir notre numéro de téléphone">
        <span class="infosPhone">Assistances</span>
    </a>
</div>

<script>
    gaEvent() {
        gtag('event', 'phone_track_click', {
            'event_category': 'click',
            'event_label': 'Clique téléphone'
        });
    }
</script>

When the user click, phone number is displayed. 用户单击时,将显示电话号码。

To see how many events over a period of time, you will use the "Behavior > Events" reports. 要查看一段时间内有多少事件,您将使用“行为>事件”报告。 Click on the "Top Events" report: 点击“热门事件”报告:

在此处输入图片说明

In your case, the event your tracking has the following structure: 就您而言,跟踪事件具有以下结构:

Category: click Action: phone_track_click Label: Clique téléphone 类别:点击操作:phone_track_click标签:集团电话

So in the "Top Events" Report, under the "Event Category" column click on the "Click" category, example: 因此,在“热门事件”报告的“事件类别”列下,单击“点击”类别,例如: 在此处输入图片说明

Once you've clicked on the "click" category, you should be presented with a list of actions within that category, click on the "phone_track_click" action 单击“ click”类别后,应显示该类别内的操作列表,然后单击“ phone_track_click”操作 在此处输入图片说明

Once you've go into that event action, you will be presented with the labels. 进入该事件操作后,将显示标签。 Do the same thing and click on the "Clique téléphone" label and you should be presented with something similar to: 做同样的事情,然后单击“ Cliquetéléphone”标签,您将看到类似以下内容的内容:

在此处输入图片说明

You can adjust your date range and see the total for that period (say a year) under "Total Events" and "Unique Events". 您可以调整日期范围,并在“总计事件”和“唯一事件”下查看该时期(例如一年)的总计。

You can adjust the graph to show by "day", "week", or "month" on the top right. 您可以调整图表以按右上角的“天”,“周”或“月”显示。 Hover over the data points to get the value. 将鼠标悬停在数据点上即可获取值。

Yes you can, you would have to use Google Analytics Event Tracking. 是的,可以,您必须使用Google Analytics(分析)事件跟踪。

Google tracks click on button and display result in format which you desire with many other additional features. Google跟踪单击按钮,并以您期望的格式显示结果以及许多其他附加功能。

Implementation : On click you would have to call this script code provided by google 实现:点击时,您必须调用由Google提供的此脚本代码

gtag('event', <action>, {
  'event_category': <category>,
  'event_label': <label>,
  'value': <value>
});

You can update this code according to your needs 您可以根据需要更新此代码

<action>, <category>, <label>, <value> // these values should be replaced according to your needs.

Sample Code 样例代码

<button onclick="gaEvent()"> Click Me <button>

<script>
gaEvent() {
  gtag('event', 'track_button_click', {
    'event_category': 'click',
    'event_label': 'My button click'
  });
}
</script>

NOTE: Add this in header of page where you want to track events update GA_TRACKING_ID with your ID. 注意:将其添加到您要跟踪事件的页面页眉中,并使用您的ID更新GA_TRACKING_ID。

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

  gtag('config', 'GA_TRACKING_ID');
</script>

All this can be referred from official documentation https://developers.google.com/analytics/devguides/collection/gtagjs/events 所有这些都可以从官方文档https://developers.google.com/analytics/devguides/collection/gtagjs/events中引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google跟踪代码管理器中的Google Analytics事件跟踪 - Google Analytics Event Tracking in Google Tag Manager 移动跟踪Google Analytics(分析)和Google Tag Manager - Mobile tracking google analytics and google tag manager 使用Google Tag Manager电子商务跟踪到Analytics(分析) - Tracking with Google Tag Manager Ecommerce to Analytics 如何获取Google跟踪代码管理器事件跟踪以发送到Google Analytics(分析)? - How to get Google Tag Manager Event Tracking to send to Google Analytics? 使用Google跟踪代码管理器时保持Google Analytics(分析)跟踪 - Keep google analytics tracking while using google tag manager 使用Google跟踪代码管理器和Google Analytics(分析)跟踪提交的表单值 - Tracking Submitted Form Values with Google Tag Manager and Google Analytics 通过Google跟踪代码管理器的Google Analytics(分析)未跟踪根网址/ - Google Analytics via Google Tag Manager not tracking root url / 跟踪Google Analytics(分析)中的JavaScript错误,但不使用Google跟踪代码管理器 - Tracking javascript errors in Google Analytics but WITHOUT Google Tag Manager 使用 Google Tag Manager 和 Google Analytics 跟踪产品查看次数 - Product view count tracking with Google Tag Manager and Google Analytics 在标签管理器/ Google Analytics(分析)中按设备/操作系统跟踪点击 - tracking clicks by device/ os in tag manager/ google analytics
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM