event-tracking

New Google Analytics event tracking wont work on mailto

徘徊边缘 提交于 2019-12-23 16:19:00
问题 I'm using the latest google analytics code: (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r; i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date(); a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1; a.src=g;m.parentNode.insertBefore(a,m) }) (window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'XXXXXXXXX', 'XXXXXXXX'); ga('send', 'pageview'); I've got event tracking to work on a download link using the following:

target=_blank doesn't work with GA outbound link tracking

允我心安 提交于 2019-12-23 09:56:58
问题 I want to track clicks on outbound links and implemented the following code: GA code var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, {'hitCallback': function () { document.location = url; } }); } Links <a class="postLinks" href="<?php if (get_field('source_link')) echo get_field('source_link'); ?>" onclick="trackOutboundLink('<?php if (get_field("source_link")) echo get_field("source_link"); ?>'); return false;"><?php the_title(); ?></a> target=_blank I

How to track Google Analytics anchor clicks using Universal Analytics

梦想与她 提交于 2019-12-22 10:59:27
问题 I'm trying to implement anchor (index.html#anchor) tracking according to this related question: How to track anchor tags with Google Analytics I use anchors to launch javascript easter eggs upon entering the website and I would like to track all the anchors as they would be a different pages (urls). So I would have tracked: link.html 20 pageviews link.html#anchor1 5 pageviews link.html#anchor2 8 pageviews The javascript easter eggs functions are currently loaded like this: $(function () // on

Why do websites like Hotjar and Google Analytics use complex tracking code instead of just a <script> tag?

微笑、不失礼 提交于 2019-12-22 09:57:01
问题 Website that use JS tracking usually use this kind of code : <script> (function(h,o,t,j,a,r){ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; h._hjSettings={hjid:9999,hjsv:5}; a=o.getElementsByTagName('head')[0]; r=o.createElement('script');r.async=1; r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; a.appendChild(r); })(window,document,'//static.hotjar.com/c/hotjar-','.js?sv='); </script> In the end, those scripts just add a <script> tag to the <head> of the page, so surely there

Google Analytics - Single Page Site - Click Tracking

半城伤御伤魂 提交于 2019-12-19 10:32:29
问题 The site in question is http://getstefan.com Its a single page portfolio site and I have tried using jQuery to add Google Analytics click tracking to every anchor tag on the site hoping to track where people are clicking. There is a script that adds a unique ID to each anchor on the page, so I set a timeout to make sure and place the Google Analytics click tracking after the id has been assigned. Like so: jQuery(window).load(function(){ setTimeout(loadOnClick,8000) }); function loadOnClick()

Can I track multiple Google Analytics events at once?

假装没事ソ 提交于 2019-12-18 04:59:09
问题 I am using Event Tracking on our conversion form to pass the values of a few drop-downs to Google Analytics as events. Our conversion form is an inquiry form for our online degree programs. I only want to pass the values of the fields on form submit, so I have added the following code to the code that runs on successful submission of the form: $("#App,#InquiryForm").validate({ submitHandler: function (form) { $(".button").attr("value", "Please wait..."); $(".button").attr("disabled",

Google Analytics Event Tracking code

允我心安 提交于 2019-12-12 09:46:00
问题 I'm using Google Analytics, at the top level I can see who has come onto my site, however I cannot see track my event tracking for my social network buttons, I think I may have developed these wrong. These events are not been tracked on my analytics account that I can see anyway if someone knows where they are kept that would be great. But the code I've used is below as I'm not sure if I have implemented this correctly: <a href="https://twitter.com/share?text=2009:%20Michael%20Jackson%20Dies

Track a Google Analytics event that occurs when a user isn't on the site

不羁岁月 提交于 2019-12-11 18:53:36
问题 Our site enables users to send money to us via a bank transfer. They 'initiate' the transfer and get a reference code. Then they log in to their bank account and send the money using the reference code. We track when a user promises to send the money but I'm not sure how to track when that money arrives. They won't be logged into the site when it happens which makes it complicated. Is there a way to do this? Thanks in advance! 回答1: It is possible to track events on behalf of a recent user,

Contact form 7 - Google Analytics Tracking

我只是一个虾纸丫 提交于 2019-12-11 17:54:34
问题 I`m trying to track submitted contact forms in google analytics with contact form 7. I tried the following: I placed the code on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit');" in the additional settings. Does not work. This method is supported until the end of 2017. The new method is "DOM events", so... ...I tried it with DOM events. I placed the code <script> document.addEventListener( 'wpcf7mailsent', function( event ) { ga('send', 'event', 'Contact Form', 'submit'); }, false );

Google Analytics Event tracking: how to avoid sending data for local test?

本秂侑毒 提交于 2019-12-11 03:08:51
问题 I'm testing Google Analytics Event tracking with my local server. I'm using the debug version of ga.js, ga_debug.js, in order to print debug text automatically in my browser console. Furthermore, i set domain name to none, which is supposed not sending the data to your Analytics account (stackoverflow post): _gaq.push(['_setAccount', 'UA-XXXXXXX-X']); _gaq.push(['_setDomainName', 'none']); ... But my events tracked are still sent to my Analytics Account, so my question is how to avoid this?