Is it possible to mail google maps using php - php

I have code for finding source and destination in google map. Is it possible to mail that map to a specific mail id using php code . please help me
thanks in advance

It is possible to mail a link to a Google Map - just put the link into the E-Mail.
Other than that, I don't think you will be lucky. Google Maps uses extensive scripting. Scripting is not supported in E-Mails.
Google Maps has a static maps API that creates images, but I don't think they do directions on that - and distributing the generated images via E-Mail would probably violate their terms and conditions.

Google maps can be built from their URL. The maps page takes certain variables form the url and uses them to calculate the entire directions. All you have to substitute your locations and way points and any other more advanced options (avoid motorways etc.) and mail that link.
example (guess the location :p ):
http://maps.google.co.uk/maps?hl=en&q=edinburgh+to+london&bav=on.2,or.r_gc.r_pw.&biw=1148&bih=766&um=1&ie=UTF-8&sa=N&tab=wl
Edit: P.S Lat and Lng Values also work in URL

Related

Can I add google analytic to an email (both html / text version)?

I am wondering whether i can add google analytic to an email.
I want to check my click rate , open rate of my sent mail. I have done some research on this and I learnt that there is a track code should be useful.
So,
Since now i am sending an html version email, is it possible to add the code into the mail?
Also,
If i want to see the result of it , is it possible i do not need to login to the google page, but connect to their server and retrieve the result and show them on my php page?
Thank you
I would say NO on this question. You could of course add the Google Analytics script-snippet to your HTML email, but I believe most e-mail clients will block the JavaScript for security reasons. Thus leaving you with inaccurate data, at best.
In your case, if you don't want to send your mails through MailChimp or some other third party service that does the tracking for you (they track both openings and clicks), I would implement my own "simple" tracking system. Each link in the email re-directs through a page that you are in control of, where you track the click and then redirect the user to the appropriate address.
Update
About getting data from your Google Analytics account, I believe you can use the Analytics Reporting API. Haven't tried it myself, but it sounds like what you are needing.
Yes , when you are sending the HTML code to the client , enclose an analytics snippet in the FOOTER of your page. That should do it. However you cannot modify the code.
You can use Google Analytics tracking code, but you will see the "visits" only.
"Visits" => When a user opens an email of you (and of course to be connected to internet)
I think this code will not work inside Outlook.
To see the results, you need to login into your Google Analytics account.
PS: Be sure to setup a valid analytics tracking code.
You can only track link-clicks with Google Analytics if your target site has the Analytics Code in it:
You can read about it here:
http://analytics.blogspot.com/2009/03/tips-for-tracking-email-marketing.html
Yes it is possible to use google analytic's to track open rates.
If you have a pure text version of a email no it is not possible to track it as it need a call to a image so it is only possible using a html version. No you do not try and embed the standard javascript for the tracking you make a direct call to the tracking gif.
There was a free service that did do this
http://web.archive.org/web/20100828084217/http://email-tracking-with-google-analytics.com/index.php

PHP Results and Google Maps

Hi I have a database with a list of contacts in which I am displaying onto a page in a list.
As part of this result set I have a post code, is it possible to generate a google map from that postcode and display it as part of the result?
If it is can any one help me get started?
You can use the post code as the location for your map and google will usually be able to find it.
For example, using the static maps API, the following url will give you a map for the zip code 92117 (which is in San Diego, CA):
http://maps.googleapis.com/maps/api/staticmap?center=92117&size=400x400&sensor=false
You can also do something along the lines of what primehunter326 was suggesting and reverse geocode using the javascript API. Which approach is best depends on what you are trying to do.
Start here for info on how to use the various Google Maps APIs:
http://code.google.com/apis/maps/index.html
Yes it is possible. The basic idea is that you use geocode to get longitude and latitude coordinates for the address. You can then use javascript to display a map on your page with all the points as markers. I'll try to find a link with that goes over it in more detail.
Here is a link which goes over geocoding
You'll need an API key in order to use their services, here

Google Maps API Business Search

I have been looking through the documentation for the API and not sure if it is possible to list multiple select stores near the submitted address.
Ultimately something like the following website: http://www.evolutionofsmooth.com/locator/
It seems like they have each location stored in a db but I can't see it that likely since it would be pretty huge to do something like that.
Any ideas?
They probably did store all the shops in a database. They saved the latitude and longitude of each shop. Then they load, via AJAX, all the shops into the google map. Google maps has a tutorial for creating a storelocator.
Google maps api v3 has a function called ClientLocation this can, on base of the IP-address, return the current position of the user viewing the google map. This way the closest shops can be highlighted or put on top of the list.
Hopes this will help!

Google adsense reference

My client has a Google Adsense account and one ad-campaign with several ads under it.
The client needs to identify the incoming users who come through clicking each ad.
The client uses Drupal PHP site.
Is there a possibility to track incoming users who come through Google ads?
Use Google Analytics. From the Features page:
Integrated with AdWords and AdSense
Optimize your AdWords performance with post-click data on your keywords, search queries, match type and more. AdSense reports show publishers which site content generates the most revenue.
You can add arguments to the urls used in the adds:
http://example.com
changed to
http://example.com?google=ad123
You can then in your Drupal check for the presence of the google argument in the $_REQUEST variable and act accordingly. This should be done in hook_boot.
http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
You may use events, and you may add custom parameters to them, but they didn't work for me on the first shot and i gave up. If you figure out how to use them please post a story on how you did that:)

Google Map with php mysql

my problem is i want to show my registered site user on to google map but dont know how to locate the user, means i dont know the latitude and longitude of every user . I am a newbie in google map so plz help
Thanks a ton
What location data do you have for your users? Cities, states, countries?
You might want to have a look at Google's Geocoding APIs.
there are two possible ways of doing this.
Ask the user to search a google map and place themselves on it. Look here for an idea on how to do this http://www.designing4u.de/2008/08/google-maps-jquery-and-xml-saving-markers-with-user-input/
Use an IP to Location database to find out the location based on their IP. Look here for how to do this http://www.ip2nation.com/ip2nation
There is no way to reliably locate a user using their IP address. However if you are developing for a mobile device it may be possible to acquire their GPS coordinates. Or you could require them to enter an address and place a point on the map from that address with geocoding.
If you are collecting the address of each registered user, you can get the latitude and longitude on the server-side through the Google Maps HTTP Geocoding Service.
You would use the following HTTP request:
http://maps.google.com/maps/geo?q=Oxford+Street,+London&output=csv&sensor=false
Simply change the q parameter with your user's address.

Categories