Track exact Geolocation with Google Analytics and show on Map - geolocation

Situation: I want to track some Data with Google Analytics on the server-side.
Problem: My application is able to provide an exact geolocation (lat, lng). I want to track it with GA as the 'users location' so i can show them on a Map in the GA Dashboard.
I know i may track custom variables/events, but am unsure how to plot them on a map in Google Analytics. My company would like to stay with one reporting tool.

You will not be able to plot these in the Google Analytics dashboard, but you should not let this stop you from moving forward. You could do this fairly easily by saving the geolocations in a custom variable and then pulling that data and then plotting it using a combination of the Data Export API and the Google Maps API. You will not, however, be able to embed this within the Google Analytics dashboard.

It currently is not possible to provide geolocation information directly to google analytics. Google automatically extrapolates that information based on data gathered from the web client (e.g. ip address), and you cannot provide that information since you are invoking tracking on the server-side.
It would be nice if google added the ability to provide at least city level geolocation data for server-side tracking, but it doesn't appear possible at this point in time.

Related

Can I use google places API (auto-complete) and Mapkit together?

I want to allow the user to select a place (Google places auto complete API) and then show the place selected on map.
Can I use google places API for iOS and apple map (Mapkit) for this purpose? Map and the selection feature will be on separate view controllers but according to https://github.com/watsonbox/ios_google_places_autocomplete ,
displaying Google Places on a non-Google map is against their terms of
service.
So if I use them together, Will my app wont be accepted while uploading or app store? Or what will happen?
From Google Terms of Use:
(d) No Use With Non-Google Maps. Customer will not use the Google Maps
Core Services in a Customer Application that contains a non-Google
map. For example, Customer will not (i) display Places listings on a
non-Google map, or (ii) display Street View imagery and non-Google
maps in the same Customer Application.
As for me it says that we can't show places list provided by Google Places API on non-Google map. But it says nothing about displaying place that was chosen from Google Places list.
More then that, I have app with exact functionality that you want and I didn't had any issues with App Store submission.

Fetch toilets list using google maps places api

The Google Map's places list does not contain toilets in it, but I need to show toilets list on Google Maps. How do I show this data using a Google API?
I'm assuming you're trying to fetch this data via the iOS SDK. You're better off using the Web Service API instead. i.e Issue an HTTP request via the app and then show the places that exist by iterating through the response.
https://developers.google.com/places/web-service/search#TextSearchRequests is a great place to start. You can use "toilets" or "toilets near me" as the search query.

Getting location coordinates from Address

The user will be prompted enter his address in a textfield and in the backend I want to get the location coordinates of the address.
I’m using geocoding service from google but not any of their APIs. I read somewhere in their document that “use of the geocoder for any purpose other than obtaining locations that will be displayed using the google maps APIs is a violation of the Terms of Service”.
And this is how HTTP request I use
http://maps.googleapis.com/maps/api/geocode/json?address=ADDRESS_STRING&sensor=false
Can I do this? I’m confused because I'm not showing any map at all but I want to get the coordinates. Will this be violating their terms?
Unfortunately, yes, I think you'd be breaking Google's rules here. See also this answer.
You could still use iOS' built-in forward-geocoding engine. See here for the docs.
Google Maps terms are very restrictive. However, it looks like they do allow showing results without Google Maps (Geocoding API Policies):
You can display Geocoding API results on a Google Map, or without a
map. If you want to display Geocoding API results on a map, then these
results must be displayed on a Google Map. It is prohibited to use
Geocoding API data on a map that is not a Google map.
So you can't display Google Geocoding API results on "non-Google" maps.
Nevertheless, please remember that you still can't cache (only lat/long on the end-use device for 30 days) and store results.
Fortunately, there are many geocoding services that are based on open data. For example, we at Geoapify allow our customers to store and even redistribute data. Try our Geocoding API, and maybe you find that it's a worthy alternative to the geocoding service from Google.

Google Analytics API displaying a single account

I've been working with the Google Analytics API to create a page showing some specific statistics. Right now everything is working, except that after the user goes through OAuth, it is displaying statistics from their Google Account.
Instead, I always want it to display statistics from a single Google Account that I own/operate, and everyone else is just viewing the data from that account.
I haven't seen a way in the GA documentation to accomplish this. I would assume the user wouldn't have to log in, because I'm just showing them my account, but it's not the end of the world if they have to.
If you're looking to create a place where users do not have to go through OAuth, you should really look at using Google's superProxy to publicly display data.

Google Analytics Reporting SDK for iPhone?

Upon exploring new ideas for apps, I stumbled on one that seemed pretty easy to do once nailed down to the right SDK, etc. I want to use Google OAuth authentication system to report Google Analytics data into my app, from the users account.
A couple days of researched turned up pretty much nothing but on how to add Google ANalytics to YOUR app to track YOUR views, etc.
Where should I begin? Does Google have Sample Code for this?
Google has a complete API for accessing the Google Analytics data. See https://developers.google.com/analytics/devguides/
There are several iOS apps out there that already use this data to provide graphical and numerical data on your GA account.

Resources