当用户关注表单字段时,我正在尝试从 Google Tag Manager 创建 Google Analytics 事件。我无法让事件显示在我的 Google Analytics(分析)帐户中,并且不确定原因是什么,我已经查看了每个步骤,并且所有代码和 GTM 设置似乎都是正确的。
我的跟踪代码管理器帐户已经在使用许多其他代码。
这是表单代码:
<div class="fancybox_form">
<form action="http://cl.exct.net/subscribe.aspx?lid=7135602" method="post" id="subscribe">
<p style="margin: 5px; padding: 0;">* Required fields</p>
<div class="row">
<p class="column large-8 small-16"><label for="">First Name</label><br>
<input class="textfield" type="text" name="First Name" required=""></p>
<p class="column large-8 small-16"><label for="">Last Name</label><br>
<input class="textfield" type="text" name="Last Name" required=""></p>
</div>
<div class="row">
<p class="column large-16 small-16"><label for="">Email Address *</label><br>
<input class="textfield" type="email" name="Email Address" required=""></p>
</div>
<div style="display: none;"><input class="textfield" type="text" name="Subscription Source" required="" value="WIN"></div>
<div class="row">
<p class="submit_container"><input class="button" type="submit"></p>
<p class="column large-16 small-16">We will never give away your information to third parties. See our <a href="http://www.renown.org/disclaimer" target="_parent">privacy policy</a></p>
<p><input type="hidden" name="MID" value="207548"><br>
<input type="hidden" name="thx" value="http://r-bestmedicine.org"><br>
<input type="hidden" name="err" value="http://r-bestmedicine.org/wp-content/themes/rhealthnews/subscribe.php"></p>
</div>
</form>
</div>
这是我在所有页面上触发的自定义 HTML 标记中的代码
射击规则——
{{url}} matches RegEx .*
标记代码 -
<script type="text/javascript">
$(document).ready(function(){
$('form#subscribe :input:first').focusin(function(){
dataLayer.push({'event':'formFieldFocus'});
});
});
</script>
这是将事件从 DataLayer 推送到 Google Analytics 的经典 Google Analytics 标签
射击规则——
{{event}} equals formFieldFocus
标签 -
Tag Type - Classic Google Analtyics
Web Property ID - account ID in a Macro
Track Type - Event
Category - formFieldFocus
Action - {{url}}
Label - {{referrer}}
任何帮助,将不胜感激