Bing Traffic API Not returning any data for Accidents/Delays? - bing

I am interested in using the Bing Traffic API to get information about traffic incidents along a specified location. I have the correct Bounding Box Co-Ordinates and they show up accurately along a location where I am interested in getting incident data for. However when I query the API with these co-ordinates, I do not get any data returned. The only incidents I do see are for road closures. I do not see any info for delays or accidents.
I am using the below HTTP URL for Query. There was a traffic congestion. I even checked on Bing Maps which showed red along the road. Am I doing anything wrong?
I even specified the type of traffic incidents to report. Still the output has "Resources Set" = 0.
http://dev.virtualearth.net/REST/v1/Traffic/Incidents/40.812728881835938,-74.035232543945313,40.847114562988281,-73.988388061523438/true?t=1,2,3,4,5,6,7,8,9&s=1,2,3,4&key=MY_KEY&o=xml
Thanks,
Kush

Related

How to get the most information from a tracking pixel, google analytics, and emails

So I am trying to track more information from our order confirmation emails or shipping confirmation emails. I have read online that tracking pixels can track IP addresses, devices, locations, and so on. I have added something like the following code to our emails to track email opens:
<img src="https://www.google-analytics.com/collect?v=1&tid=UA-XXXXXXXX-X&t=event&cid=test&cn=test&cs=email&ec=pixel&ea=open&el=my_email" width=1 height=1 style="display:block;">
Is there a way to get any more data using this method? Or do I have to use some other service in combination with the code in the emails?
Is there a way to get any more data using this method?
Sure, manually crafting GA requests is called measurement protocol in Google Analytics jargon. You can add/override a wide list of fields, here's the complete list from the documentation for référence:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
And an article, also from official Google docs, related to email tracking with measurement prorocol (event though it is quite short):
https://developers.google.com/analytics/devguides/collection/protocol/v1/email
Bé careful for the value used with the cid parameter, as it is used to.discriminate between clients. Using the same value everywhere will count every open as coming from the same user. But I believe the value "test" provided here is just for the sake of the example.
Please also be careful not to send any PII data to GA (name, postal adress, ...)

Tracking Email Opens

I'm attempting to track email opens to determine whether social health resources are reaching patients who request them. I've briefly read about using utm parameters or tracking pixels, but am unsure of exactly how to do this.
Thanks all.

How do I fetch the facebook events of a particular location

I would like to fetch all the facebook events by passing a latitude or longitude or a place, As FQL support is no more, I've tried the following query
search?q=*&type=events&center=37.76,-122.427&distance=1000
But the results I get are from syria, India, USA, Hungary and all, why I'm not getting the events from only that location I've specified. Is there any legal issues in fetching the public events from facebook, How many number of eevnns I can fetch at a time??
There is no way to directly search for events in a specific area. The center and distance parameters are only available for Places, as you can read in the docs: https://developers.facebook.com/docs/graph-api/using-graph-api#search
More information:
https://www.facebook.com/help/community/question/?id=10201749749651827
How can I query public facebook events by location/city?
About "how many events can i fetch", those are the API rate limits: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting
API results usually have a limit of 25 entries for one API call. But you can set it higher:
/search?type=event&q=test&limit=100
Legal issues depend on what you want to do with the data, impossible to say without knowing the details for your App.

Maximum number of results for realtime API

We have a user who is getting 1000 results back from a realtime API query but is expecting more.
From the docs:
https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime#resource
It does not appear that the realtime API response contains a facility for paging.
Is it correct to assume this API endpoint:
https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get
Can return a maximum of 1000 results?
You need to remember that real-time is still beta. The real-time request doesn't include a next link which means there is no way to get extra data back.
Try setting &max-results=10000 see what that returns. The max rows for the Reporting API is 10000, however I have been unable to find any information on what the max number you can set in the Real-time API is. Real-time isn't returning an error if I set it to 10000 however I don't have an account with that many real-time users so I cant test it. I am going to send Google an email to see if I can get a verification what the max number is for the real-time api.
https://www.googleapis.com/analytics/v3/data/realtime?ids=ga:78110423&metrics=rt:activeUsers&access_token={accessToken}&max-results=10000
You might want to add a issue request to issues - google analytics requesting that they add nextlink at the very least.

Tracking User Location in Database

I am creating an application that will track user locations and create incident tickets related to this information. Therefore I have the following setup
Basic Setup
iPhone App: Tracking user location (lat, long) and reverse geocode the information
Server: Database for saving incident tickets including the location information
I am struggling now with the “right way” to save location information for tracking users and incidents. The flow should be as follows:
Intended Approach
Tickets being created should be persistently saved with the information given, like lat, long, address so I see a table of incidents that happened
The geo information should be efficiently handled in terms of reverse geocoding, as I thought about caching the address and lat,long info, which could possibly not allowed to google TOS
Application / Server Workflow
Iphone App User hits a button and executes a POST request sending lat/lng to the server
Server system creates a ticket associated to this request and saves this ticket info in a table called incidents
The challenge I am facing now, is how to handle the management of location data correctly, like the address information. As I want to use reverse geocoding to get the street name associated with the latitude and longitude information, I could use the Reverse Geolocation service on the iPhone or GoogleMaps API. The first question I am having is:
Question 1)
Should I reverse geocode on the iPhone and send the address info via POST request to the server as well and save the info in a table?
Question 2)
Should I only sent lat/lng information and do reverse geocoding on the server before I save the data to the database
The next step I am struggling with is, how to efficiently save the data in the database, considering database normalisation.
Currently whats happening on the server is:
Create incident
When the server receives the POST request coming from the app, an incident ticket is being created and saved to the table incidents
The user lat/lng posted to the server from the app will be used to attach this info to the ticket entry to be saved in the database
So the current table format is:
incidents (id, incident_reference, address_id, latitude, longitude)
Now I do not know where to save the corresponding reverse geocoded information (address)
Question 3)
Should this information be saved with the ticket info itself? I see challenges there, as I would create redundant information
So the current table format would be:
incidents (id, incident_reference, latitude, longitude, street_name)
Therefore I could use the reverse geocode info I receive from the iPhone app directly to save it directly to the incidents table. But wouldn’t that be a bad practice though? I think I would create multiple times the same address information, which would not be good in terms of database normalisation? It somehow does not look like a good idea….
To find a solution, I thought about creating a separate address table with the following table setup:
incidents (id, incident_reference, address_id, latitude, longitude)
addresses (address_id, latitude, longitude, street_name)
Question 4)
Using this approach I would imagine, that I could then cache the already received reversed geocode info, to save it in the database and query my table addresses next time for an existing address. The challenge i see here is, that there would be possibly never the exact same latitude/longitude so I would have duplicate address entries with different lat/lng information in the table.
Q1: No, leave that to the server, to reduce the impact on the iPhone (bandwidth usage, battery usage)
Q2: See Q1
Q3: see comment
Q4: what is your question? Are lat/lon the same for different incidents on the same address? I very much doubt it.