How can I use EasyTracker in Android - android

I have a Android project and plan to send data to Google Analytics.
I would like to use EasyTracker and send activity start and stop info. I found just a function like this:
EasyTracker.getInstance(this).activityStart(this);
It works, but in Google Analytics report the package name and I want set custom tag for this.
Can I do this? How?

Related

Implementing Adword Remarketing with GTM Android

I am implementing GTM in Android project which will not use GoogleAnalytics SDK or Adword SDK,but I want data in Google Analytics and Adword.
In order to achieve this,
I have implemented Google Anaytics tag in GTM,Added Rule {Always},
Screen Name data is being sent to GTM which is reflected in Analytics,This is tested and working properly
I need InstallReferrals for Application which also should manage through GTM.
To achieve this,
Added a tag in GTM for Adword with the type Adword Remarketing,
Added ConversionId and label from Adword.
Added tagmanager.InstallReferralService and tagmanager.InstallReferralReceiver to Android manifest.xml.
According to source code of InstallReferralService it passes data to CampaignTrackingService of Analytics,which should upload data to Adword and Google Analytics.
But I am unable to get any data.
Please correct me if I am doing anything wrong in this process.
I also need Adword Conversion Tracking to be used through GTM without Adword SDK.
Not sure how to achieve this.

How to configure Android Google Tag Manager v4 with Google Analytics (Universal Analytics)

I'm trying to use Google Tag Manager to report screenviews and events to Google Analytics. I followed the google's tutorial but I'm not able to even report the screenviews.
Also spent hours searching in google but there was no match. Almost all the information available is for Android's v3 or the old GTM web interface.
This is my configuration
Pushing the event to the data layer throws no error. However screenName seems not been sent.
Java code
public static void pushScreenViewEvent(#NonNull Context context, #NonNull String screenName) {
DataLayer dataLayer = TagManager.getInstance(context).getDataLayer();
dataLayer.pushEvent("screenView",
DataLayer.mapOf("screenName", screenName));
}
Debug log after push data
02-23 19:12:39.376 31787-31888/com.example.debug V/GoogleTagManager﹕ Sending hit to service PATH: https: PARAMS: sr=1080x1776, a=558676027, v=1, ht=1424686354314, an=Example app, ul=ja-jp, t=appview, _u=.L, tid=UA-XXXXXX-1, cid=XXXXXX, aid=com.example.debug, av=1.0.0,
Google Play Services version
compile 'com.google.android.gms:play-services-base:6.5.87'
There's this tutorial but it is for the old GTM v3 with the old GTM web screenshots
https://developers.google.com/tag-manager/android/v3/ua#screenviews
Ok, it was my fault.
There was two problems.
Fields to set were wrong
In order to track the screen in GA it's necessary to set the Screen Name's Measurement protocol parameter &cd
In my case Client Id and User Id are also necessary, that's why I send &ci and &uid
I was using a default binary container from a different test account. After use the correct container it worked like a charm.
It seems like firing rule is incorrect.
Try something like {{event}} equals screenView or Always as firing rule.
And it will take 24hrs to update in the Google Analytics dashboard, so it will not appear in the real time. Let me know if it doesn't work.

How to use tracking id of google analytics in android app?

I am trying to integrate google analytics with my android app. I followed the steps in the following link:
https://developers.google.com/analytics/devguides/collection/android/v3/#manifest
Then i tried the look at the statistic of my app, but it seems like analytics is not working, i must have done something wrong. The problem is, in those steps we do not make use of the tracking id, and in google analytic's web site, it says that
Download the Google Analytics SDK for Android or iOS and implement the tracking code,
including this tracking ID.
What does it mean to "implement the tracking id"? What should i do about this can anyone help me?
Thanks
Use this:
Tracker tracker = GoogleAnalytics.getInstance(context).getTracker(ga_trakingId);
Then you can SET some variables, that will be send to GoogleAnalytics:
tracker.set(Fields.APP_NAME, "Best Android Application");
tracker.set(Fields.APP_VERSION, "1.0");
To SEND some info, events:
tracker.send(MapBuilder.createEvent("UX", "App Launch", null, null).build());
You must watch Behind the Code: The Google Analytics v3 Mobile SDKs, all info from there.
Update 1
Google Analytics API v4 you should create google-services.json file from here and then you can use:
public Tracker getTracker() {
return GoogleAnalytics.getInstance(this).newTracker(R.xml.global_tracker);
}
And then you canuse it like this way:
getTracker().setScreenName("SomeScreenOrActivityName");
getTracker().send(new HitBuilders.ScreenViewBuilder().build()); // send screen name
The new process generates a file by Google which is called GoogleService-Info.plist.
This file contains (key, string) and one of them is:
<key>TRACKING_ID</key>
<string>*YOUR TRACKING ID*</string> // Auto generated by GAI
Just open the file and confirm that this is your tracking ID.

How to set Google Analytics api key programmatically?

I can't find how to do this. There's this documentation: https://developers.google.com/analytics/devguides/collection/android/v2/advanced - it shows this method:
gaInstance.getTracker(trackingId)
Where trackingId is the api key, but I think this can be used only after the tracker is already configured right? It's not to set the api key.
I need this, because my app has to track to different accounts, depending of a certain server configuration. The server will send me the api key where to track to.
Thanks in advance.
P.S. I'm using Google Analytics V2.
I did this:
GoogleAnalytics gaInstance = GoogleAnalytics.getInstance(context);
Tracker gaTracker = gaInstance.getTracker(apiKeyGA);
gaInstance.setDefaultTracker(gaTracker);
Seems to work. I have to confirm although.
I put it somewhere after initialization, after my webservice returns. I save it in prefs to access quicker the next time.
Edit: Doesn't work. It keeps tracking with the string I put in XML, and when I remove the element, it doesn't track anymore. But I let it here for now, maybe it leads to a correct answer.

javadoc.zip for libGoogleAnalytics.jar in android

I'm trying to extend the tracking via google analytic on my android app. Currently I'm trying to send custom variables. But it seams that I'm missing the java docs for the library, can someone please send me the javadoc.zip. Also how do I send a custom variable with a trackPageView or trackEvent method(call). I seams that I can't specify in witch method(call) I'll be using the custom variable.
For example I need to call the trackEvent on a button click and also send a custom var with it, or I need to call the trackPageView and send a custom war with this method.
Thanks
Download GoogleAnalytics Android SDK 2.0 beta 3 from https://developers.google.com/analytics/devguides/collection/android/resources.It has javadocs.zip.
To send custom Variables in Google Analytics Android ,you can use this api call
EasyTracker.getTracker().trackView("My Custom Variable:"+ x); This Value will be visible in Screen Views of Google Analytcs Dashboard
The trackEvent is for events, and the trackPageView is for pageviews.
EasyTracker.getTracker().trackEvent("MainPage", "Info buttonclick", "date today", (long) 1);
And pageviews
EasyTracker.getTracker().trackView("MainPage");
see: Analytics events and pageviews

Categories

Resources