I have sent much data by Tracker to Google Analycis as following codes:
tracker= GoogleAnalytics.getInstance(this).getTracker("UA-46451607-1");
HashMap<String, String> hitParameters = new HashMap<String, String>();
hitParameters.put("type", "appview");
hitParameters.put("screen_name", "My Screen");
tracker.send(hitParameters);
After sent these data to platform,where can i see the result?
I would like to see the value of "type " and "screen_name",but i dont know how to view them on web.
Check it.
import com.google.analytics.tracking.android.EasyTracker;
import com.google.analytics.tracking.android.Fields;
import com.google.analytics.tracking.android.MapBuilder;
public class YourBaseActivity extends Activity {
#Override
public void onStart() {
super.onStart();
EasyTracker tracker = EasyTracker.getInstance(this);
tracker.activityStart(this);
String trackingId = "UA-ABCDEFG-I";
tracker.set(Fields.TRACKING_ID, trackingId);
String category = "Activity Lifecycle Callback";
String action = "onStart()";
String label = "Screen: " + getClass().getSimpleName();
tracker.send(MapBuilder
.createAppView()
.createEvent(category, action, label, 0L)
.build();
);
}
#Override
protected void onStop() {
super.onStop();
EasyTracker.getInstance(this).activityStop(this);
}
}
Then go to www.google.com/analytics/. Click Access Google Analytics.
And on the screen: tab Reporting (at the top panel) -> Real-time -> Events. And you'll see something like this (maybe not immediately, but within a few minutes):
Select category (at the bottom of the figure - here is CATEGORY_ACTIVITY_CALLBACK) and you'll see a number of actions:
But unfortunately I still have not found a way to see "not-realtime" data.
Sorry for my English
Follow these steps
open this link www.google.co.in/analytics/
Click on access Google Analytics button in the right side of the top most corner of this screen.
It will redirect you to your home screen. Here you can see your app name
Click on All Mobile App data link on home screen just below the title of your project
It will redirect you to App overview page.
It is where you want to be . Yo can see complete report and details of your app.
You may want to use Fiddler2 as a proxy to view the data.
open your Google Analycis account. You can check all the details related to the app. use this link
https://www.google.com/analytics/web/?hl=en#report/app-overvi/a46388977w77407404p80019218/
and Sign up the account.
When your offline to see the google analytics report follow the below steps.
Step 1. Go to Reporting
Step 2. Behavior and check Overview and Screens
Note: The total report will submit to google analytics once in 24hrs of time
Related
I am trying to use Assist api inside my application, i followed most of the tutorials, but could not find a proper tutorial which will completely tell how it should be implemented. i have added this to the activity. is there anything else to be done in manifest or anywhere in the project. When debugged this below method got called but nothing
#Override
public void onProvideAssistContent(AssistContent outContent) {
super.onProvideAssistContent(outContent);
outContent.setWebUri(Uri.parse("https://commonsware.com"));
try {
String structuredJson = new JSONObject()
.put("#type", "Book")
.put("#author", "https://commonsware.com/mmurphy")
.put("publisher", "CommonsWare, LLC")
.put("name", "The Busy Coder's Guide to Android Development")
.toString();
outContent.setStructuredData(structuredJson);
}catch(JSONException jsonEx){
Log.e(getClass().getSimpleName(), "What happend", jsonEx);
}
}
i am seeing, it always shows NOTHING FOUND ON THE SCREEN when i long tapped the home button
i want to simply open a url through assist api from my application by long tap on home button
That is not your decision to make. You can offer a URL to the assistant. What the assistant does with that URL, if anything, is up to the developers of the assistant.
In my tests when the Assist API came out, I concluded that the then-current implementation of Google's Now on Tap ignored onProvideAssistContent(), but that the onProvideAssistContent()-supplied data was available if assistants wanted it.
what i need to modify
To force the assistant to do something with onProvideAssistContent(), you would need to write your own assistant, then convince the user to switch to your assistant.
Can someone please provide an example for a real case where I might need to use OnProvideAssistDataListener. I can't seem to wrap my head around it. I look at the source code, and then I look online. Someone online says
Application.OnProvideAssistDataListener allows to place into the
bundle anything you would like to appear in the
Intent.EXTRA_ASSIST_CONTEXT part of the assist Intent
I have also been reading through the Intent Docs.
There is an Now On Tap functionality implemented by Google. By long pressing the Home Button, you will get some information displayed on the screen. The information you get depends on what you're viewing on your screen at that time. (for eg: Music app displays information about music on the screen).
To provide additional information to the assistant, your app provides global application context by registering an app listener using registerOnProvideAssistDataListener() and supplies activity-specific information with activity callbacks by overriding onProvideAssistData() and onProvideAssistContent().
Now when the user activates the assistant, onProvideAssistData() is called to build a full ACTION_ASSIST Intent with all of the context of the current application represented as an instance of the AssistStructure. You can override this method to place anything you like into the bundle to appear in the EXTRA_ASSIST_CONTEXT part of the assist intent.
In the example below, a music app provides structured data to describe the music album that the user is currently viewing:
#Override
public void onProvideAssistContent(AssistContent assistContent) {
super.onProvideAssistContent(assistContent);
String structuredJson = new JSONObject()
.put("#type", "MusicRecording")
.put("#id", "https://example.com/music/recording")
.put("name", "Album Title")
.toString();
assistContent.setStructuredData(structuredJson);
}
For more info refer https://developer.android.com/training/articles/assistant.html
I made an application showing a window while calling in certain case, using service component.
The window contains info of callee.
I wanna know how to track this window.
Few buttons would be added with functions - ex : sending sms.
And I just wanna count how many times this window has been shown.
I found this question - Android: can I use Google Analytics inside a Service?
But it seems it's about old version of GA.
And I failed to make that in my app.
(I tried :
public class view extends Service {
...
GoogleAnalytics mGA;
Tracker gat;
...
#Override
public void onCreate() {
super.onCreate();
mGA = GoogleAnalytics.getInstance(app);
gat = mGA.getTracker("UA-my-account");
Map<String, String> params = new HashMap<String, String>();
params.put("event", "test");
gat.send(params); )
Let me know how to make tracker work in my app with GA V3.
Thanks for any help.
I made it.
GA = GoogleAnalytics.getInstance(YourContext);
Tracker = GA.getTracker("Your UA-xxxxxxxxxxxxxxxxxxx");
1. Tracker.send(MapBuilder.createEvent("category","action","label",long type value).build());
2. Tracker.set(Fields.SCREEN_NAME, "SCREEN NAME");
Tracker.send(MapBuilder.createAppView().build());
now wait for a day for this to be shown.
I'm having trouble while implemented the new google tag manager lib.
Here is what I did:
I create a macro dataleyr
I set a rule for an event
I create a tag and set the universal analytics ID on it
I publish my container
Then I tried to use it in my app like this
TagManager mTagManager = TagManager.getInstance(this);
DataLayer mDataLayer = com.google.android.gms.tagmanager.TagManager.getInstance(this).getDataLayer();
ContainerOpener.openContainer(
mTagManager, CONTAINER_ID, OpenType.PREFER_NON_DEFAULT,
TIMEOUT_FOR_CONTAINER_OPEN_MILLISECONDS, new ContainerOpener.Notifier() {
#Override
public void containerAvailable(Container container) {
container.refresh();
// Save container for use by any other activities in the app.
com.appsconceptelite.appsconceptelite.testfunctionnalities.gtm.ContainerHolder.setContainer(container);
mContainer = com.appsconceptelite.appsconceptelite.testfunctionnalities.gtm.ContainerHolder.getContainer();
Utils.pushOpenScreenEvent(LearnActivity.this, "Learn Screen");
}
});
and the method I use to push event is
/**
* Push an "openScreen" event with the given screen name. Tags that match that event will fire.
*/
public static void pushOpenScreenEvent(Context context, String screenName) {
DataLayer dataLayer = TagManager.getInstance(context).getDataLayer();
dataLayer.pushEvent("openScreen", DataLayer.mapOf("screenName", screenName));
}
When I run this code in debug mode, I get the right container name and version but when I check in Google Analytics dashbord, I see no events like if no data have been pushed.
Can you tell me what I'm doing wrong?
Not sure if it will solve the issue but what tripped me is the old google analytics account that hasn't been created a "Mobile apps" account and no results would be seen on the account but were definitely sent out. Create a new "Mobile apps" property and try again.
Following Google Sign Button, I implemented it on my android device.
When clicking the button it shows you a popup asking your permission:
Know Who you are on Google.
Now what?
It looks like this gives me nothing. It does not provide me access_token, or any user data.
What is it good for?
*Please do not tell me how to get access_token this is not what the question is about
You have to implement ConnectionCallbacks. And in onConnected(), you can start to get user data you want from the google plus account. Here's my sample code for the function:
#Override
public void onConnected(Bundle connectionHint) {
// We've resolved any connection errors.
mConnectionProgressDialog.dismiss();
String accountName = mPlusClient.getAccountName();
Person p = mPlusClient.getCurrentPerson();
String displayName = p.getDisplayName();
google_text.setText(String.format("email:%s\ndisplay name:%s",accountName, displayName));
}
You can see more Person data in Google's link: Person
Your class must implements ConnectionCallbacks and one of provided methods is onConnected() method. When the flow reaches your implementation of onConnected() method (which means that you have successfully established connection with google) you can call lets say mPlusClient.getCurrentPerson(). The return type is instance of Person class where you can find anything about person who chose google plus login.