How to set custom variables through the new analytics.js of GA

Custom Variables don’t exist any more in analytics.js (aka Universal Analytics). It has been replace with Custom Dimensions and Metrics that are more flexible and powerful. Advantages of Custom Metrics and dimensions: They can be used in filters They are first class citizens in the interface, so you will see the custom variable name in … Read more

Is it possible to track hash links like pages with google analytics?

Generically, your code could look like this _gaq.push([‘_trackPageview’,location.pathname + location.search + location.hash]); You could either bind that code to every time you have a hash change within your application, or you could use a generic hashchange plugin, that uses the HTML5 onhashchange, and some backwards compatible hacks for older browsers, and bind this code to … Read more

What is the client ID when sending tracking data to google analytics via the measurement protocol?

Integer or UUID The cid is the equivalent of the second value in the _utma cookie when you use the javascript tracking. In js tracking, it is a random integer (generated by Math.round(2147483647 * Math.random())). But it is strored and sent as a string : so you can use both formats (integer or UUID). Required/Optional … Read more

Events not being tracked in new Google Analytics (analytics.js) setup

If you are using Google Tag Manager and also want to trigger some events via code, ga(‘send’…) does not appear to be enough. You need to first fetch the appropriate analytics object: if (“ga” in window) { tracker = ga.getAll()[0]; if (tracker) tracker.send(“event”, “Test”, “Test GA”); } Note that this assumes you’re only using a … Read more

Track event in google analytics upon clicking form submit

Use Google Analytics hitCallback You can specify a custom callback function on the tracker object. _gaq.push([‘_set’, ‘hitCallback’, function(){}]); The callback is invoked after the “hit is sent successfully.” If you want to track a click on a submit button and send the form afterwards you can use the following code (uses jQuery) for your event: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)