google-analytics

The New 'Universal' Google analytics script on an AJAX based website

一世执手 提交于 2019-12-04 05:40:23
Google analytics now comes in two options: 'Classic' and the new 'Universal' which has more features. (Actually the 'Universal' analytics has been available to paying customers for a while, but now its available for free!) With the 'Classic' analytics, which looks like this: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-Y']); _gaq.push(['_trackPageview']); (function() { SOME MORE CODE })(); </script> I have found from much googling that to track Ajax based websites (i.e. where the pages are loaded by AJAX but the navigation menu remains static and

Google Analytics Regex - Alternative to no negative lookahead

我只是一个虾纸丫 提交于 2019-12-04 05:38:27
Google Analytics does not allow negative lookahead anymore within its filters. This is proving to be very difficult to create a custom report only including the links I would like it to include. The regex that includes negative lookahead that would work if it was enabled is: test.com(\/\??index\_(.*)\.php\??(.*)|\/\?(.*)|\/|)+(\s)*(?!.) This matches: test.com test.com/ test.com/index_fb2.php test.com/index_fb2.php?ref=23 test.com/index_fb2.php?ref=23&e=35 test.com/?ref=23 test.com/?ref=23&e=35 and does not match (as it should): test.com/ambassadors test.com/admin/?signup=true test.com

How can I measure retention using Google Analytics Mobile SDK

岁酱吖の 提交于 2019-12-04 05:38:26
I would like to create a retention cohort analysis for my mobile Android application using Google Analytics Mobile SDK. Basically I would like to segment my cohort by date of installation (e.g. group all users which installed my app on the same day) and measure retention after two weeks (e.g. how many of each group are still using the app after two weeks). I want to end up with a graph showing a date on the X-axis and the relevant retention percent for that date on the Y-axis. I was able to do this in the past (using the previous analytics version) by using a custom variable which indicated

Google Analytics not initialising in Swift

时光怂恿深爱的人放手 提交于 2019-12-04 05:36:26
My new swift app does not initialise Google Analytics for some reason. I created a bridging header in my project for all the GAnalytics files: #import "GAI.h" #import "GAIDictionaryBuilder.h" #import "GAIEcommerceFields.h" #import "GAIEcommerceProduct.h" #import "GAIEcommerceProductAction.h" #import "GAIEcommercePromotion.h" #import "GAIFields.h" #import "GAILogger.h" #import "GAITrackedViewController.h" #import "GAITracker.h" And this is part of my AppDelegate.swift file: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool

Getting user info using Client ID

依然范特西╮ 提交于 2019-12-04 05:17:14
问题 I have inserted the analytics.js tracking script into my code, and now I am trying to get user data such as medium, source, etc. using javascript and putting them into variables. Is there a way I can do this using Client Id? 回答1: I assume you mean getting the data in realtime for use in your website. That is not possible. Client ID is not exposed in the interface by default, you'd need to use a custom dimension. There is a processing delay, report data may only be reliable the next day. While

Two analytics on one page

我怕爱的太早我们不能终老 提交于 2019-12-04 05:11:30
问题 How can i put two GA codes on a site. I have this 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', 'UA-55738390-2', 'auto'); ga('create', 'UA-55738390-3', 'auto'); ga('send', 'pageview'); But the 2nd analytics code

Google c# Api, changing from v2.3 to v3

陌路散爱 提交于 2019-12-04 04:46:24
问题 I have the following code to query google analytics using the C# v2.3 api: string username = "SAMPLE@SAMPLE.COM"; string pass = "PASS"; string gkey = "?key=XXXXXXXXXXXXXXXXXXXXXXXXXXX"; string dataFeedUrl = "https://www.google.com/analytics/feeds/data" + gkey; AnalyticsService service = new AnalyticsService("API Sample"); service.setUserCredentials(username, pass); DataQuery query1 = new DataQuery(dataFeedUrl); query1.Ids = "ga:34197921"; query1.Dimensions = "ga:medium,ga:campaign,ga:date,ga

Google Universal Analytics Localhost Setup

半城伤御伤魂 提交于 2019-12-04 04:33:23
I'm trying to test GA on localhost after following the suggestions in Can you test google analytics on a localhost address? 1). but I don't see any data being send to my Google Analytics account when browsing on my localhost server and calling the JS script. I know it's executing the JS. What am I doing wrong? Here is my JS 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','/

Parsing __utmz tracking cookie to get referral

久未见 提交于 2019-12-04 04:26:12
I use Google Analytics on my site, and I want to read __umtz cookie to get referring link. I made some research and I wrote such code: $refer=explode('utmcsr=',$_COOKIE['__utmz']); if(count($refer)>1) $refer=explode('|',$refer[1]); $refer=addslashes($refer[0]); The problem is, this is not always working, sometimes I get junk as result. What I am doing wrong? Maybe someone have a good description of this cookie? Joao Correia Check my Google Analytics Cookie Parser . Google Analytics PHP Cookie Parser is a PHP Class that you can use to obtain data from GA cookies such as campaign, source, medium

How can i convert my google analytics web app into mobile app?

最后都变了- 提交于 2019-12-04 04:24:42
I have a mobile apps that i applied my google analytics track IDs but when i create the google analytics app profiles i initially choose web app instead of mobile app. while exploring around the settings, I could not find a switch to convert it into mobile app. I have more than 10 app with different google analytics track id, so i don't think creating new profile is great solution, there might be switch to change it to mobile app. Someone out there might have encounter this situation. please help. Solution: What i did to solved this was create a new App, same name with the web one, then set it