开发者

Track goals ajax form with Google Analytics

Thank you for taking the time to read my question.

I have an ajax form on my website and I'm trying to track the signups. I have read multiples post on SO on the subject but cant make it work.

This is a copy of the code of my form: http://pastie.org/1916397 And there is a screenshot of my goal config in Google Analytics: http://i.stack.imgur.com/m2TX5.png

I have signups, but Google Analytics dont seem to detect them ! :(

I have that Google Analytics tag on my code:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXX']);
  _gaq.push(['_trackPag开发者_运维百科eview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Thank you by advance,


From your pastie:

<input class="submit-element" type="submit" name="contact" value="Signup!" onlick="javascript: _gaq.push(['_trackPageview', '/outgoing/button-click']);" />

Unless you're triggering an event when a user licks a form, the problem is that your attribute is misspelled. It should be onclick, not onlick.

Happens to the best of us :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜