Google Analytics API and custom variables? - api

We've got a web directory and we'd like to use google's API to display demographic numbers to our clients for pages that their directory listing is shown for. We've reviewed GA's analytics documentation and can create graphs, but no way that we can see to grab metrics (like percentage of mobile users vs desktop) for ONLY pages where those custom variables were present.
For instance, on the directory search page, we want to be able to tell customer X that their business showed up 100 times, that 78% of them were mobile users, and that a breakdown of cities. How can I do this using GA's API code?

For any future googlers, this is not currently possible through the API.

Related

Send Google Analytics Data to eCommerce Server

We want to save in our database (custom-developed shop with C# and ASP.NET) where our customers came from to improve our marketing strategies, so:
Is it possible to send google analytics data to the eCommerce server while performing a checkout?
You need to enable the ecommerce option on your google analytics dashboard.
Then, enter the tracking code on the purchase confirmation page.
You can consult the link below:
https://support.google.com/analytics/answer/1009612?hl=en
It is also possible to identify the user's origin to improve their marketing campaigns. Just follow this:
https://support.google.com/analytics/answer/1033173?hl=en
The Real Time Reporting API enables you to request real time data—for example, real time activity on your property.
However you can extract information such as pages and events, not ecommerce data. Therefore you should make sure to track the checkout funnel so that the information is within an event (with category, action and label). At that point you can use the API I indicated.

How to get description for Google API nearbysearch items

I am developing a web app for client requirement in that i am using Google API for finding nearby place
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=.....
I was able to get all the required details. Name, rating, etc but only description is missing. will i be able to get it from anywhere, i tried
https://maps.googleapis.com/maps/api/place/textsearch/json?query=...
but not getting required result only country or place is getting here not restaurant or venue description. Please help me to get details for each item in nearby search result. Or any other suggestions
Based on the documentation of both Google Places API Nearby Search Requests and Google Places API Text Search Requests, description property is not included in the returned results. You could rather file for a Feature Request to include description to each returned places in the results here at Google Public Issue Tracker.
Issue Tracker is a tool used internally at Google to track bugs and
feature requests during product development. It is available outside
of Google for use by external public and partner users who need to
collaborate with Google teams on specific projects.
You can learn more about Issue Tracker through this link.
I would also like to suggest to read Google Places API Place Details. It returns more comprehensive information about the indicated place such as its complete address, phone number, user rating and reviews.
Hope this help!

Using google custom search API to find images

I want to use Google's Custom Search API to find images using GET request. Like described here. But I don't want to look on images on one specific site, but want to get results like this. How I can do this with the Custom Search API?
Sending this request returns nothing:
https://www.googleapis.com/customsearch/v1?key=[MY_KEY]&cx=017576662512468239146:omuauf_lfve&q=some+request&&safe=off&searchType=image&fileType=png. This cx is from google's manual
I must set cx param, but this value links my request to site, specified in cse control panel. However I don't want to limit my results to one site.
According to the documentation here:
Google Custom Search > Overview
Google Custom Search enables you to create a search engine for your website, your blog, or a collection of websites.
It doesn't sound like that is what you are trying to do (you don't seem to want to search a predefined subset of resources).
I'm aware the question is over 6 years old, but better late than never. It's possible to create a Google programmable search engine that can search the entire web for images. When you create a programmable search engine, there is an option to search the entire web instead of just web sites that you specify. See https://programmablesearchengine.google.com/about/.
As an alternative, you could try Bing Image Search API. There is a limit to the number of image searches you can submit per day for free, but I have rarely hit the limit.

Instagram api sandbox

I today get Instagram api and add my website live,
I see write:
Client Status: Sandbox Mode GO LIVE
I can't click on ''GO LIVE'' button why ?
You would need to start a submission for approval to go live, though:
Feeds for websites won't be approved; these will remain in sandbox mode and be limited to 500 requests per hour and 20 images. This doesn't sound like much especially for large clients, but if you cache your responses, it's not a problem.
The main confusion is because they have made it sound like every app/feed has to be approved and out of sandbox mode to work, where as the reality is that only fully functioning apps for phones, or a widget plugin really ever need to be.
You will no longer be able to display feeds based on hashtags, only a users own photo's. By getting a client to be a sandbox user, is how you can access their feed without their login information.
Older apps/feeds will need to be updated to use the new code before June or they may stop working.
It's mainly to stop apps hammering instagram's servers for unlimited requests on any hashtag/users they like.
Here is an example of how to fetch and cache images using WordPress's 'set_transient' - you will need to use a loop to output the data.
WordPress Instagram Gist
Here is the relevant piece of information in the dev docs:
Here are some examples of scenarios that will not be approved:
To display content for a personal website. If you are a developer and you want to showcase Instagram content on a website, then you do not need to submit your app for review. By using a client in sandbox mode, you will still be able to access the last 20 media of any sandbox user that grants you permission.
One-off projects. If you are an agency building websites or other integrations, note that we don't grant permissions to clients created for one-off projects. If you are interested in building a product, platform, or widget that will be used as a service across multiple projects, then you may submit a single client_id that you can use across multiple projects.
To use a widget. If you are installing a widget for your website, then you do not need to submit for review. Some widgets may ask you to create a new client id, but you do not need to submit it for review for the widget to work. Your client can remain in sandbox mode and the widget will have access to your last 20 media.
Hope that helps clear some confusion.

Can you upload data to the Google Analytics API?

There are companies out there that claim to "integrate" data into GA. I know some phone call tracking companies in particular. Is there a way that they are uploading data to GA through the API or are they using some other method that doesn't require that?
There is no upload mechanism into Google Analytics besides manual __utm.gif calls like in the browser. Both Google Analytics APIs (Data Export and Management) are completely Read-Only.
There are a few ways these solutions work, but one of them is to generate a unique identifier for the person calling in to give the person on the other line. That code is linked to their referral information (grabbing from the cookies). Another solution is to have the customer manually input their phone number. That phone number is then dialed by the software and connected to the live person, and in the background the phone number is linked to the source information from the cookies.
Then, the person receiving the call either inputs the code it into the system, or automatically has the user's information, and at the completion of the call, depending on how it is resolved, can generate things like e-commerce transactions or particular pageviews for Goals, so it can generate __utm.gif calls with the relevant campaign and user data appended. As far as Google Analytics is concerned, the request formed is the same user. The only thing that will be different is the User Location (which is fairly inaccurate to begin with.)
ie, if I take the __utm.gif call from my computer, paste it to you, and you click it, Google will see that as an another pageview on this visit, and for most purposes ignore that the differing locations.
Well, Google Analytics works off the a tracking GIF with all kinds of data appended to it, so it can certainly be reproduced by these phone call tracking folks without a problem.
Phone call comes, request the 1x1.gif from google with tracking data suiting your needs, and the hit+data will soon register on GA.
http://www.google-analytics.com/__utm.gif?data-here&account=UA-blah&more-stuff
There are several options to send tracking data to Google analytics.
Use a library which implements the ga.js script server-side
When you use Google Analytics in the way described by Google, you include a script on your website. This script sends data from the visitors browser to the Google Analytics server.
This script has been reverse engineered and implemented in server-side libraries. Now you can send the same data from the server to the Google Analytics server. You can use PHP-GA for PHP or pyga for Python.
Use the Google Analytics measurement protocol
The Google Analytics measurement protocol is a new API to send data to Google Analytics. You can send data by sending POST requests to the API.