google-analytics

Google Analytics OAuth2: How to solve error: “redirect_uri_mismatch”?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 18:07:46
问题 I'm trying to get this example to work: https://developers.google.com/analytics/devguides/config/mgmt/v3/quickstart/web-php#enable The error I'm getting is "Error: redirect_uri_mismatch" . In order to install the google api resources, I used composer with this command: php composer.phar require google/apiclient:^2.0.0@RC This installed the "vendor" folder in my root site folder. My index.php and oauth2callback.php files are located in the "public_html" folder. Here's a screenshot of my error

Google Analytics Embed API Server Side Authorization not rendering the charts with C#

爱⌒轻易说出口 提交于 2019-12-03 18:06:08
问题 I am trying to render charts using Server Side Authorization in C# but I am not able to do it. Google has an example but based on Python and I need to build based on C# MVC: https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/ I have created the Service Account and downloaded the JSON file: Controler public class StatsController : Controller { // GET: Stats public async Task<ActionResult> Index() { var json = "C:\\temp\\client_secrets.json"; string[] scopes = new string[] {

Big Query - Google Analytics - Time diff between first visit and purchase

十年热恋 提交于 2019-12-03 17:32:25
Trying to get a list: visitorid, time first visit, time of hit where transaction occurred. What've I've written is only grabbing rows that have transaction revenue. I am also trying to convert visitStartTime which is a unix date, to a regular date via Date(visitStartTime) but that's failing in the group by because of the outputted date. Any direction super helpful. SELECT fullvisitorID, visitNumber, visitStartTime, hits.transaction.transactionRevenue FROM [75718103.ga_sessions_20150310], [75718103.ga_sessions_20150309], [75718103.ga_sessions_20150308], [75718103.ga_sessions_20150307],

What is the cookie dot rule?

谁说胖子不能爱 提交于 2019-12-03 17:22:44
I am using Google Analytics and Google Website Optimizer together. On our development rig I suddenly realized that some cookies were set twice. The GA cookies: __utma __umtb __utmc __utmz where all set both by GWO and GA. I had only expected to see one set of these cookies. GWO set them with a dot in front of the domain name: .dev.example.com While GA set them as: dev.example.com I tried to google this and read something about it in RFC2109 HTTP State Management Mechanism Searches for it here on SO, results in a number of answers referencing the "cookie dot rule", but I still don't really get

Universal Analytics - push multiple values for one dimension and one pageview

大城市里の小女人 提交于 2019-12-03 17:15:33
问题 I am trying to use google universal analytics and its custom dimensions. On one page, I want to send multiple values for one (and one only) dimension. I tried: ga('send', 'pageview', {'dimension1': 'grumpy cat'}) ga('send', 'pageview', {'dimension1': 'happy cat'}) When I use google API, I can get for my dimension1 all the values I just sent - so it works well. However I think (I am not sure about it) that I should not send several times a pageview hit on the same page because it would disrupt

Multi-domain setup on Google Analytics

孤街醉人 提交于 2019-12-03 17:14:30
We have a dozen or so sites, as well as the occasional subdomains so: example.com example.co.uk us.example.com etc We have been using separate GA codes for each site. This works fine, but it means that adding a new site means getting a new code and we can't tell overall stats (e.g. how many people have visited all sites etc). If we went the one code route and set up separate profiles for each domain/subdomain: 1) Should we use _setDomainName("none") or _setDomainName("www.example.com") and _setDomainName("www.example.co.uk") etc 2) Will each domain profile treat the other domains as separate

Google Analytics Events Canceled

不问归期 提交于 2019-12-03 16:37:34
There is a serious issue with attaching Google Analytics event tracking to a hyperlink on a page (as demonstrated in the documentation). Example: <a href="http://www.example.com/" onclick="_gaq.push(['_trackEvent', 'Links', 'Click', 'Example Link']);" > Example! </a> When user clicks on such a link in the Google Chrome browser, GA is starting to send the request to the server (event tracking), but browser is also starting to load another page (following the link) and the GA request is getting "canceled", so the event is not reaching the GA server and is not shown in the statistics. How can we

Google Tag Manager & Optimize Server-Side experiment sending variation

拥有回忆 提交于 2019-12-03 16:30:14
I'm using the Google Tag Manager container for managing scripts. I'm trying to perform a server-side Optimize/Analytics experiment. I require server-side for performance reasons. I've performed client-side experiments just fine with the GTM/Optimize containers. Here's my GTM code: window.dataLayer = window.dataLayer || []; .... <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager

Test Google Analytics on Localhost

浪尽此生 提交于 2019-12-03 16:25:05
问题 I need to test some custom firing events using Google Analytics. I'd like to test in a local environment. I've set up my test site using apache with server name: my-ga-test.localhost/ According to Can you test google analytics on a localhost address? and Google Analytics docs, I'm able to adjust my GA code to use: ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none' }); I tried to set up a new account to get a tracking ID for this site, but I'm getting the following error: URL ends with an

Getting query results with Legato gem

拥有回忆 提交于 2019-12-03 16:24:47
Trying to get query results from Google Analytics using Legato gem (following a previous recommendation I go there + some research). Seems to be simple to define my query, however I fail to understand how to actually get the results. Reading the readme shows how to build some "building blocks", but I fail to get an object where I can read the results from. Maybe I missed something, and the query results should be written directly to the model (DB), which is not what I want (I wanted to go over them first). Maybe that's the reason I'm not seeing anything. So can someone please share an example