What I am trying to do here is, suppose a hospital which provides certain facility has several centres(locations) in the country. Now when the user requests for such hospital, the bot should be able to output him the location of the nearby hospital. I do have the list of all such hospitals in Firebase Real-Time Database with respective longitude and latitude.
My appraoch is to get the user's location and compare it with the available locations in the database for a nearby location?
On this link, It is discussed how to get the location of the user using "Google Actions". I want to do the same thing (getting the precise location of the user) using dialogflow-fulfullment (WebhookClient({ request, response });) from Inline editor on Dialogflow so that I can use Real-Time Database of Firebase.
My motive is to make it inclusive to most of other platforms as well. Whereas, Google Actions are only valid for Google Assistant.
PS: Any suggestion on this would be highly appreciable. I would be happy to put more clarification if required.
Getting the user's permission for location is only a feature of Actions on Google and not Dialogflow itself. You could ask the user to provide their current location manually, but would face difficulty doing it automatically otherwise.
Spoke with Dialogflow Support Team
Mentioned link in the email: https://developers.google.com/actions/reference/rest/Shared.Types/Permission
You can use Actions on Google Helpers to retrieve the user location. You can follow this link for documentation: https://developers.google.com/actions/assistant/helpers#user_information
Related
I've been asked to help with a site using Google's mapping APIs (mainly Maps Javascript) and we can see the API key on the site but we have been unable to trace which Google account this is associated with. I can set up a new account and a new key and then change the site code, but with another site I have worked on Google had applied a very hefty transition credit after the recent billing changes, plus having the original account access will allow me to see historic usage stats and work out potential future costs under the new allowances.
I realise it would be a security/privacy breach to just reveal the email, but is there any way anyone knows that you can enter an API key and for example have it send a password reset or similar email to the account email address?
API keys are not associated to google accounts. An API key only identifies the project associated to the call for billing and quota purposes (and of course to allow or deny the resource). You cannot “reset” an API Key but you can create a new one.
I can't seem to find out which state my users are coming from. The only data I see is that they are in the U.S. is there a way to configure something in Firebase so that I can track which states my users are coming from?
You can use the StreamView to see where users coming from at the City-level at real-time on the map. However, if you would like the data, I think you can do it yourself by using Geo location and log a user property with the location data.
I need to track E-Commerce data in my Google analytic account using measurement Protocol. In the request I need to send following data and those data need to be tracked in my account.
Billing City (utmtci)
Billing Region (utmtrg)
Billing Country (utmtco)
But when I tried to find the parameters for these using enter link description here I could not find any matching parameter. Please help if any one know whether I can track these using measurement protocol.
This has been discussed (but not yet answered) here - basically it seems those fields have been deprecated.
I do not see that spelled out in the documentation, but those field do not appear in the parameter reference, not in the API (via the query explorer) and not in the GA user interface. If stuff is not part of the documentation it's pretty safe to assume that it is not there.
You can create custom dimensions in your property settings and send the geo information there.
I'm developing an application where each 'business' has its own page (or rather many pages):
For example example.com/business/abc/
So, for the logged in business owners in the system I would like to give a feature 'View page analytics'. It would display how many visits (and maybe a couple of other things) that particular page has had.
Is there a way of doing this using the Google Analytics API with my constraints:
I don't want customers to provide their own UA code
I don't want them to require to have GA account
Customers don't need to have Google email account
I don't want to build the entire frontend and backend myself. I would rather use something existing
I've been researching this topic for hours trying to come up with a solution and can't figure out anything.
Here is what I tried and what problems happened to me:
http://ga-dev-tools.appspot.com/demos/embed-api/
This is basically exactly what I want for my customers to be displayed on my site (like in the examples), except that Embed Api tries to authorize users to their own (owned) google analytics. I want it instead to use my own Google Analytics data (or rather part of it)
The way I thought about limiting data access would be for every one of my customers to create a View in GA, Add filter to that View so only customer pages are listed there, assign User to the view, and use the Embed Api to display data from that View only. There are a couple of problems with that:
To assign User to View we need email address. And this must be either google account email, or account from a project created with Google Developers Console (application).
In other words I can't create (in any way that I know) an account that would be a shield account for my customers to a subset of my GA data that they would be interested in. It must be either a real user or a real application email address.
So what I tried to do is... I created an app in Google Developers Console, Created new OAuth Service Account. Using Ruby code (that in production app would be running on backend) I obtained OAuth token. I added this email of my OAuth service account as a User to the View
I wanted this server side generated oauth token to be used by Embed Api. That would achieve the effect that I generate the token for on my backend and user can use it without having GA user in my GA property. So I changed according to documentation the basic Embed Api example to use
gapi.analytics.auth.authorize({
container: 'auth',
clientid: 'xxx.apps.googleusercontent.com',
serverAuth: {
access_token: 'Server side generated token'
}
});
instead of
gapi.analytics.auth.authorize({
container: 'auth',
clientid: 'xxx.apps.googleusercontent.com',
});
The effects are not quite what I expected. The example doesn't show anymore (I can't see my data) but I can see in Netowrking section in Chrome that it is actually receiving real data from GA. But for unknown reason, nothing is appearing.
What I try to avoid is building a solution in which I need to build server side code that is querying GA for data, providing it to the frontend and then JS is responsible for displaying it. I would rather use Embed API but it seems not to be well suited for the use case where I don't want users to play with their UA data but rather with my own UA data limited to some scope. I would like to have at least the frontend or backend part of the solution solved. The solution doesn't need to be even Google Analytics based. Anything else that would let me achieve the use case easily and let the business owners see the effects of their marketing (traffic, sales) would be interesting as well.
Related:
Using google analytics API to show subset of data for customers of web application
Google analytics customer data?
Google Analytics API: filter by URI?
https://embeddedanalytics.com seems like something that could be useful, but their page and graphs look like from a few years ago. I would like something more pretty.
https://oocharts.com seems to be interesting because of what their docs.oocharts.com says about queries. But they don't charge anything for their product so I am skeptical of their business model and whether it is a good long-term solution. update: dead link
I don't have enough karma to post links ;)
TLDR: Displaying subset of my GA data to my customers without forcing them to become GA users and adding them to my GA account.
Any help appreciated!
Without seeing your code it's hard to know where the problem is, but using the serverAuth option definitely works. And when using the serverAuth option, you don't need to specify a client ID or container, all you need to enter is the following:
gapi.analytics.auth.authorize({
serverAuth: {
access_token: 'Server side generated token'
}
});
Here's an example that will work if you enter in a valid access token and the idsfor a view to which you have access:
http://jsbin.com/vukezoheyeco/3/edit
Note: when doing auth like this, it happens sync. This can be a gotcha if you're used to an async auth flow (like normal) and you add an event handler listening for the "success" event after calling .authorize because then your handler will never run.
I think you need the Google Analytics Super Proxy
You download the github package and upload to your own App Engine project, do some minimal configuration and then you have an interface where you can setup Google Analytics API calls which require no user login.
It provides end user URLs that you can use to construct data tables in your front end, it also provides data-table format so it slots right into Google Charts.
So for example, you have a user that needs access to visits, revenue for site section /sectionA/
You set up the GA super proxy to serve them a URL that only includes data for that section - you can try out queries here in the GA query explorer. In this case, metrics=ga:visits,ga:productRevenue and filter~=ga:page=/sectionA/
This produces an end URL with JSON data, that refreshes daily/hourly - your choice. You import this URL into your app.
The end user then logs in to your app, and sees the chart data generated from the end URL for their login. They don't need to know about GA super proxy, they just see the end resulting chart.
You could get more sophisticated by providing dropdowns to select which data chart they see, which changes the GA super proxy URL that is requested.
Using the Google Analytics API I would like to display the domain associated with each GA profile. Is this possible or is there another way to do it? I have been unable to find any documentation for the domain.
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html#accountResponse
http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html#profileFeed
I can't use profileName because depending on how the user has their GA account setup, it may just be a string and not a domain.
One thing you might do is perform a query using ga:hostnames as the dimension and either ga:visits or ga:pageviews as metrics. This will yield a chart of the host name (what is in the browser address bar) to reach that site. Sort of a hack in a way. Technically you can use a single GA Tracking code on multiple sites. So there is no "Official" domain name associated with a profile.
Unfortunately, I don't think it's possible with the current API. Furthermore, you can't explicitly depend upon the domain they enter as the only domain the profile is tracking since there is further customization that allows the user to specify if they want to track subdomains and/or top-level domains. I believe your only option is to ask the user the same information Google asks the user and help the user understand they will have to manually keep two lists in sync due to limitations of the Google API.