简体   繁体   English

Google Analytics(分析)事件跟踪设置

[英]Google Analytics Event tracking setup

Can someone help me write the proper GA setup for the following HTML code? 有人可以帮我为以下HTML代码编写正确的GA设置吗? I"m trying to track the downloads of the media kit and the capabilities (both PDF's) I'm running analytics.js and it's pretty connfusing to me unfortunately. 我正在尝试跟踪媒体工具包的下载以及我正在运行analytics.js的功能(包括PDF),不幸的是,这确实让我感到困惑。

Here is the code. 这是代码。

<div class="row">
    <div class="twelve columns">
        <div class="tabs-content-container">
            <div class="eight columns">
                <img src="img/brochure.jpg" alt="blog" style="padding-bottom: 10px;">
            </div>
            <div class="four columns">
                <h3>Download Company Overview</h3>
                <p>Thank you for taking the time to learn more about our company. The additional information in these brochures will tell you more about our history, products and references.</p>
                <p>Our printable company overview brochure is now available for download. Both documents require <a target="_blank" href="http://get.adobe.com/reader/"> Adobe Reader</a>. Click the links below to download our company’s Capabilities and Media Kit.</p>
                <a target="_blank" href="Capabilities.pdf">Download Capabilities &nbsp;&#8594;</a>
            </div>
        </div>
    </div>
</div>
</section>
<!-- end section-tabs -->

<section class="msg-container diff-msg" style="margin-bottom:0;">
    <div class="msg-inner-container">
        <a target="_blank" href="MediaKit.pdf" class="download">Download Media Kit</a> 
    </div>
</section>

the issue is that I'm used to the ga.js style of event tracking in which I would have done something like this: <a href="MediaKit.pdf" onclick="_gaq.push(['_trackEvent', 'download', 'one-sheeter', 'about harbordev',, false]);" class="download">Download Media Kit</a> 问题是我习惯了ga.js样式的事件跟踪,在这种情况下我会做这样的事情: <a href="MediaKit.pdf" onclick="_gaq.push(['_trackEvent', 'download', 'one-sheeter', 'about harbordev',, false]);" class="download">Download Media Kit</a> <a href="MediaKit.pdf" onclick="_gaq.push(['_trackEvent', 'download', 'one-sheeter', 'about harbordev',, false]);" class="download">Download Media Kit</a> . <a href="MediaKit.pdf" onclick="_gaq.push(['_trackEvent', 'download', 'one-sheeter', 'about harbordev',, false]);" class="download">Download Media Kit</a> That however doesn't work with analytics.js and the documentation doesn't really make sense to me. 但是,这不适用于analytics.js,并且该文档对我而言实际上没有任何意义。

Thank you 谢谢

I figured it out. 我想到了。

onClick="ga('send', {'hitType': 'event', 'eventCategory': 'download', 'eventAction': clickedDownload', eventLabel': 'Capabilities' });"

thanks to everyone who tried to help. 感谢所有尝试提供帮助的人。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM