简体   繁体   English

带有gtag的Google Analytics(分析)虚拟页面视图

[英]Google Analytics virtual page view with gtag

I'm very new to Google Analytics. 我是Google Analytics(分析)的新手。

How can I make a virtual pageview only for a dynamic page included in a HTML template? 如何仅对HTML模板中包含的动态页面进行虚拟综合浏览?

Please just refer to my code below to know more details of the situation. 请仅参考以下我的代码以了解这种情况的更多详细信息。

A dynamic page [Price Details] pops out when you press the button [Show Price]. 当您按下按钮[显示价格]时,会弹出一个动态页面[价格详细信息]。

URL or even template doesn't change when this dynamic output appears, because they both are in ONE template. 出现此动态输出时,URL甚至模板都不会更改,因为它们都在一个模板中。

I'd like to count up how many people actually have seen [Price Details], so can anyone tell me how to get a virtual pageview only for the dynamic page? 我想算一下实际上有多少人看过[价格明细],所以谁能告诉我如何只为动态页面获得虚拟浏览量?

I'm using gtag for your info. 我正在使用gtag作为您的信息。 I will appreciate so much any idea about this! 我对此表示非常感谢! Thanks! 谢谢!

<div class="section">
<a href="#" id="buttonSet" class="button"><span>Show Price</span></a>
</div>
・・・
・・・
bla bla
・・・
・・・
<header class="head">
    <p class="title">Price Details</p>
</header>

尝试添加以下onclick浏览量触发器:

<a href="#" id="buttonSet" class="button" onClick="ga(‘send’, ‘pageview’, ‘/virtual/guides/download/social-media-guide.pdf’);><span>Show Price</span></a>

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

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