i have 2 different apps in the appstore, i am saving some data in a database (sql) like uid, ip, what page the user is on etc.
Is there a way to give a unique visitor an id or something like that so i can track the users activity in both apps.
And is it possible to see what buttons the user is clicking on.
I have added google analytics to the app but i only can see that there is a user on com.example.mainactivity and not the html pages that are the app.
Hope you guys understand what i mean.
You can use Google analytics to solve this problem with two different approaches. You can use the built in userId feature and it will even keep track of cross device sessions.
/**
* An example method called when a user signs in to an authentication system.
* #param User user represents a generic User object returned by an authentication system on sign in.
*/
public void onUserSignIn(User user) {
// Be careful when creating new trackers -- it is possible to create multiple trackers for the
// same tracking Id.
Tracker t = GoogleAnalytics.getInstance(context).newTracker("UA-XXXX-Y");
// You only need to set User ID on a tracker once. By setting it on the tracker, the ID will be
// sent with all subsequent hits.
t.set("&uid", user.getId());
// This hit will be sent with the User ID value and be visible in User-ID-enabled views (profiles).
t.send(new HitBuilders.EventBuilder().setCategory("UX").setAction("User Sign In").build());
}
Alternatively, you can use the Data Import feature to import external user infromation from multiple sources such as CRM data base and your SQL data base and you need to map their user representations to your own custom dimensions. You can follow the example in "Importing User Data to create AdWords Remarketing Lists" article. It shows how to use a custom dimension to represent a user id, and then upload even more custom dimensions about that user.
ga('create', 'UA-XXXX-Y', 'auto');
ga('require', 'displayfeatures');
ga('set', 'dimension1', 'NNNN'); // Where NNNN represents the CRM User Id.
ga('send', 'pageview');
Remember though Google Analytics does not support sending Personally Identifiable information, see the TOS.
Related
Well we can count more than three years since Safaricom released the M-Pesa APIs as RESTful APIs accessible through their developer portal. Their Github repository, has a sample android application that uses "Lipa na M-Pesa Online" API. This API initiates an M-Pesa transaction on behalf of the user of an app, the user needs only to input their M-Pesa PIN to complete the transaction.
public STKPushService mpesaService() {
return getRestAdapter().create(STKPushService.class);
}
Now is their something similar for AirtelMoney because I have clients who want to have all the mobile money payments we have in Kenya in their app. Its worrying that their is more of Mpesa than other apis? I am looking for a way to incorporate airtel money to my app like we do on Mpesa because we already have apps that support airtel money
POST https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest
Has anyone tried this AirtelMoneyLib which I see was last updated 3 years ago.
<?php
/**
*
*/
require_once('config/Constant.php');
require_once('lib/AirtelMoney.php');
$airtelclient=new AirtelMoney;
//Call the processing function with parameters as shown
//You can do a retrieval of data from a request at this point
//Not advisable to pass the username and password in request. Rather use an environment variable for the same
/**
* $Username=$_POST['username'];
* $password=$_POST['password'];
* $msisdn=$_POST['msisdn'];
* $referenceId=$_POST['referenceId'];
* $timeFrom=$_POST['timeFrom'];
* $timeTo=$_POST['timeTo'];
*/
$referenceId="1601056579194";
$timeTo="";
$timeFrom="";
$airtelclient->processMerchantQuery(USERNAME,PASSWORD,$referenceId,MSISDN,REQUEST1,$timeTo,$timeFrom);
?>
I need to know a few things that are making it hard for me to even get some feedback when a http request is sent.
A recent google search pulled up new API called LIPISHA now kind off open source on github how the set back with it is that it comes with a huge price tag
That is why am trying to see how this old api can work for me
There is a new SDK library currently in beta testing that I have been working on under a company called Interswitch. It will handle multiple payment channels including cards banks and multiple mobile money providers. Currently it handles Visa, Mastercard, Verve, Mpesa and Equitel. Soon more will be added. I don't know about pricing at the moment but you can reach out to Interswitch for a test account and I'll be able to provide technical support that you may need in integrating. Check out the code at its github repo
Let's say I have 4 apps, "Uber Clone" for iOS and Android and "Uber Driver Clone" for iOS and Android. I am using the same Firebase project for all 4 since they share the same database.
When it comes to Facebook Auth though, I can only add a single Facebook app to Firebase. And for every Facebook App I can only add a single iOS and a single Android app. Therefore how can I make this work?
Firebasers, any recommendation/solution in mind?
Multiple apps on a single Facebook app
Go to your Facebook developer console
Go to your app's page
Go to the basic settings
Add all relevant bundle IDs
Here's the key: Add a different URL Scheme suffix for each app. This differentiates each iOS app under your single Facebook App.
In each of your apps info.plist add the suffix information (Make sure both the URL scheme is updated and the "FacebookURLSchemeSuffix" is added!)
Now each of your apps is under the same Facebook App, and thus can register under the same Firebase Realtime Database. Check this out for more info: Two iOS apps using the same Facebook app ID - is it possible?
At this point in time, it does not seem possible to have multiple FB apps under a single Firebase Realtime Database.
A single Facebook App is allowed to connect to multiple iOS apps and multiple Android apps.
For iOS apps, you can specify multiple Bundle ID at Facebook App settings page.
Taken you're using Firebase for authentication, I presume you're using either Real Time Database or Cloud Firestore to store user data as well.
In your user data model, you can add user types.
For example,
user_type : "driver"
Then query users like so:
DBreference.collection("users").whereField("user_type", isEqualTo: "driver").getDocuments() {(querySnapshot, error) in
if error != nil { print(error.debugDescription)
return
}
else if let users = querySnapshot.documents {
for user in users {
guard let userType = user.data()["user_type"] as? String else { return }
print(userType)
}
}
}
This way you don't have to create multiple Facebook apps. Just use the one you have and segment users and their priviliges accordingly.
For example, upon login on both apps, do a check, whether the is user trying to log in as a driver or a passenger.
if currentUser.userType != "passenger" {
print("You can't log into the passanger app with your driver's account.")
}
Hope this helps.
I am trying to set user information to crash reports in crashlytics in Android App, so that it will help me to find out which of our users experienced a given crash. I have explored and found there are 3 APIs can set user information in crash report.
Those are,
void Crashlytics.setUserIdentifier(String identifier);
void Crashlytics.setUserName(String name);
void Crashlytics.setUserEmail(String email);
It is recommended to use all the APIs. All documented at http://support.crashlytics.com/knowledgebase/articles/120548-how-do-i-set-user-information-
But I have no idea,
1. How to get user-identifier, name and email details, which are input to those APIs?
2. Which place in program to call these crashlytics APIs?
Please share some ideas, how to implement this.
Regards
Annada
Looks like detail UI in Fabric has been changed.
Select one of crash issue.
Click Version in Recently Activity
On detail page top right hand corner, you should see affected user information.
If your application uses some form of user identification (i.e. login, email, phone, device specific id) you can use that as crashlitics user information. I suppose you can generate user id when your app is first launched and save it in shared preferences, for example. It'll be shown at top-right corner of detailed crash view.
i.e. I set ID and name as soon as user authenticates in my app.
You typically want to set them as soon as possible (as your data arrives) and all info has been initialized.
For new Firebase api
FirebaseCrashlytics.getInstance().setUserId("12345")
For More
Customize your Firebase Crashlytics crash reports
I have integrated Google Analytics into my Android app. The app is a photo printing app which contains a set of predefined themes that users can choose. However, is it possible to retrieve the stats from Google Analytics (e.g., the top 5 themes selected by user) using some api rather than using the Google Analytics console?
What you are looking for to retrieve the information is the Core Reporting API. Because the Google Analytics API requires all requests to be authenticated and your users are not authorized to access your Google Analytics account It is probably best to set up the API call on the server side using a service account here is an example of how to set up a python application to use a service account to access the API.
But what should your query be?
analytics.data().ga().get(
ids='ga:' + profile_id,
start_date='30daysAgo',
end_date='today',
metrics='ga:totalEvents',
dimensions='ga:eventLabels').execute()
Your application will need a way to access the results of the query from your own servers. You might also want to look into using the Google Analytics Super Proxy which solves a similar problem of allowing external users to access the results of an authenticated API request.
You could create an event in Google Analytics that would effectively track this. Events have Categories, Actions, labels, and event values. So you can fairly effectively add a theme or anything you wanted as a dynamic value. Then you would be able to search and sort in Google Analytics on the event category and find which Theme was used the most
#Override
public void themeSelected(String theme) {
// May return null if a Tracker has not yet been initialized with a
// property ID.
Tracker tracker = Tracker.getInstance(this);
// that are set and sent with the hit.
tracker.send(MapBuilder
.createEvent("Theme", // Event category (required)
"Theme Selected", // Event action (required)
theme, // Event label - Can dynamically set this with the theme that was selected so you can search in Google Analytics on it.
null) // Event value
.build()
);
}
Screenshot showing sorting off of the Event Label. My labels were numbers that users entered. Notice you can see the number of times each one was entered in the TotalEvents Column which should give you the information you were looking for
I am new to Google Analytics.
I want to track my application by unique user id.
I am using Google Analytics SDK for Android v3.
I have this code on onStart().I read about user id and created a new view for user tracking.
Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-xxx-2");
tracker.set(Fields.SCREEN_NAME, "Main Acitivty");
tracker.set("&uid", id);
tracker.send(MapBuilder.createAppView().build());
But I am not getting how can I get this uid in my Google Analytics Console,
I am trying to track user by their user_id , so I can get complete report of particular user.
I am able to get count of the total active user , screens and hit events.
But I didn't get any success on getting the same report user-wise.
I also tried to create custom dimension and metrics but those are also not reflecting on account.I have no idea Where can I check this field.
For custom variables :
easyTracker.send(MapBuilder
.createAppView()
.set(Fields.customDimension(1), "premiumUser")
.build()
);
I have searched , but I didn’t find any good tutorial on this.
Any help, suggestion , reference link would be greatly appreciated.
Thanks.
User Id is only used internally to make sure that the sessions from one user are tracked together - it just makes your stats more accurate, and enables cross device analytics.
You cannot acces the userId though:
User ID - Feature Reference
Limits
The User ID value can not be queried as a dimension in reports in either the web interface or the APIs
Also be sure not to send any user id like name or email:
User ID Policy
You will not upload any data that allows Google to personally identify an individual (such as certain names, social security numbers, email addresses, or any similar data)
You can find User ID Converage under Behaviour in the Audience section
check this image: