geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.95k stars 517 forks source link

Provider GoogleMapsBusiness is missing channel query key #895

Closed aamalain closed 5 years ago

aamalain commented 5 years ago

Provider GoogleMapsBusiness should accept "channel" attribute in __construct and use it in buildQuery

jbelien commented 5 years ago

Hello @aamalain ,

I'm not familiar with Google Map Business. Could you give us a bit more information and documentation about this channel key ?

Thanks a lot.

aamalain commented 5 years ago

The channel query string param is used only for analytics. For example, if you use the same account on multiple domains, the channel might contain the domain name.

Here is some documentation about it: https://developers.google.com/maps/premium/reports/usage-reports#channels

The URL will be like:

https://maps.googleapis.com/maps/api/js?v=3
&client=gme-yourclientid
&signature=your_signature
&channel=your_channel
jbelien commented 5 years ago

Understood. I guess it's an optional parameter, right ?

I'll try to find some time to add it in the Google Maps Geocoder provider ! 👍

aamalain commented 5 years ago

yes, it is optional

maxhelias commented 5 years ago

You have already this feature here

Use it like this : GoogleMaps::business($client, $clientId, $privateKey, $region, $apiKey, $channel) :wink:

jbelien commented 5 years ago

Even better, thanks @maxhelias ! 🎉