google analytics – multiple trackers on one page (cookie conflict)
Now made easy with the new asynchronous tracking code. 🙂 https://developers.google.com/analytics/devguides/collection/gajs/#MultipleCommands
Now made easy with the new asynchronous tracking code. 🙂 https://developers.google.com/analytics/devguides/collection/gajs/#MultipleCommands
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
I had to add both libz.dylib and AdSupport.framework to the build phases to make this go away. Google doesn’t include these in their instructions so going to check with them to make sure this is OK then will update this post. UPDATE: Now you also need to add libsqlite3.0.dylib to get it to work.
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
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
_ga=1.2.286403989.1366364567; 1st Field This is a versioning number. In case the cookie format changes in the future. Seems to be fixed at 1 at the moment. The one above is an old format. Newer cookies have this value set at “GA1” 2nd Field This field is used to figure out the correct cookie in case … Read more
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
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
Select the GoogleService-Info.plist in the project navigator (the file hierarchy on the left side of Xcode). Then, if it isn’t open yet, open the utilities bar (click the top-right most button in Xcode). You will see a section ‘Target Membership‘. Check all the checkboxes to add the .plist to all targets. In most cases it … Read more