google-analytics

Android Google Tag Manager

喜欢而已 提交于 2019-12-02 04:27:01
I am implementing Google Tag Manager for Android Application V4 as requested by my Marketing team for future use,and I have never worked on GTM for websites so I am naive in this context. I have created account and Container and tags according to instructions on official site. I have linked tag manager with google analytics tracking id. I have written code in my application according to instructions on website and downloaded container to raw folder. When I run my app it gives me warning and verbose in logcat W/GoogleTagManager﹕ Resource is a UTF-8 encoded string but doesn't contain a JSON

Google Analytics throws 403 error

若如初见. 提交于 2019-12-02 04:22:23
问题 I am attempting to download metric data from Google Analytics using C# and am performing user authentication with OAuth 2.0. I'm using the Installed Application authorisation flow, which requires logging into Google and copy-and-pasting a code into the application. I'm following the code taken from google-api-dotnet-client: private void DownloadData() { Service = new AnalyticsService(new BaseClientService.Initializer() { Authenticator = CreateAuthenticator(), }); var request = service.Data.Ga

Track Goals across subdomains in Google Analytics

♀尐吖头ヾ 提交于 2019-12-02 03:53:14
We have two platforms, a marketing site and a SaaS solution. The marketingsite is on the main domain like www.domain.com and the SaaS solutions is on our subdomain sub.domain.com. I would like to track the conversion rate of the customers signing up on our SaaS solution through our marketingsite. If I go into goals for the marketingsite I can choose a relative path to the goal like www.domain.com/signup-completed, but the actual signup is on sub.domain.com/signup-completed. How can I track this on the marketing site? The two sites are setup as different properties under the same account. First

Google Analytics API deviceCategory

青春壹個敷衍的年華 提交于 2019-12-02 03:53:08
问题 I am trying to use the Google Analytics API (v3) in Google Scripts to pull Device Category information from Google Analytics. Within Analytics under Audience -> Mobile -> Overview there is a Device Category section listing 'tablet', 'mobile' and 'desktop' . I wish to pull these numbers into a Google Sheet that my script is attached to. The code I believe I should be using is: ga:deviceCategory==mobile (to pull mobile traffic) and ga:deviceCategory==tablet to pull tablet traffic. However, I

Google Analytics API error 403: “User does not have permission to access profile”

戏子无情 提交于 2019-12-02 03:52:57
问题 I've been trying to learn how to use the Google Analytics API to get site traffic data. I keep running into an error saying that the user does not have permission to access the profile. I added the email address from the service account to the users and tried making it both a user with access to all profiles and an administrator and neither worked. This is my code, which I got from here: string scope = AnalyticsService.Scopes.AnalyticsReadonly.GetStringValue(); string clientId = "xxxxxxxx

Google analytics integration for a custom Order received page in Woocommerce 3

断了今生、忘了曾经 提交于 2019-12-02 03:25:20
问题 I have a custom thank you page for after checkout is finished in WooCommerce where I need to insert order data into a Google ecommerce tracking tag to record the sale in analytics. One part of that is adding the following for each item in the order... ga('ecommerce:addItem', { 'id': <?php echo $order_id?>, // Transaction ID. Required. 'name': 'ACME Product', // Product name. Required. 'sku': '1234', // SKU/code. 'category': 'Product Category', // Category or variation. 'price': '10.00', //

Track button views and clicks as events in google analytics

倖福魔咒の 提交于 2019-12-02 02:53:36
I am trying to place a button that will be inside email and I want to track button views and clicks (Google Analytics events). Can you tell me if that is possible and how to do that? You can't technically track a button click from an email, but what you can do is control where the button links to. If you set the button's URL to point to your servers, you can intercept the link, send a hit to Google Analytics using the Measurement Protocol , and then redirect the user to where the button was originally pointing. Alternatively, you could append custom campaign parameters to the end of the URL (

What's the technique that the Google analytics tracking code uses?

半城伤御伤魂 提交于 2019-12-02 02:23:41
问题 The Google Analytics tracking code looks like this: (function() { code })(); What's the technique they are using with those brackets - (stuff)() - called? What does it do? I put the Google Analytics code before the closing head tag on my page and then put an if statement around it like this (I include a Jquery cookie plugin further up): <script type="application/javascript"> if ($.cookie('allowcookies') == 'yes') { analytics code } </script> It didn't run until I used the same technique

Pulling Google Analytics Multi Channel Funnel data via API

元气小坏坏 提交于 2019-12-02 02:17:11
I am trying to pull the multi-channel funnel reports from the Google Analytics API and am getting the following error: Invalid value 'mcf:source'. Values must match the following regular expression: '(ga:.+)?' Here is the code I am using, it works fine when the dimensions & metrics are from the ga:... family, but for some reason it won't let me pull mcf: reports. $analytics = new Google_Service_Analytics($client); $analytics_id = 'ga:XXXXXXXX'; $lastWeek = date('Y-m-d', strtotime('-26 day', time())); $today = date('Y-m-d', strtotime('-26 day', time())); try { $optParams = array(); $optParams[

Google analytics integration for a custom Order received page in Woocommerce 3

╄→尐↘猪︶ㄣ 提交于 2019-12-02 02:14:06
I have a custom thank you page for after checkout is finished in WooCommerce where I need to insert order data into a Google ecommerce tracking tag to record the sale in analytics. One part of that is adding the following for each item in the order... ga('ecommerce:addItem', { 'id': <?php echo $order_id?>, // Transaction ID. Required. 'name': 'ACME Product', // Product name. Required. 'sku': '1234', // SKU/code. 'category': 'Product Category', // Category or variation. 'price': '10.00', // Unit price. 'quantity': '1' // Quantity. }); but with inserting the order item's real data using PHP, not