Google Geolocation and geocoding PRICE HIT!

Just got a nasty surprise bill from google under new pricing model, getting hit about $5 per day.

Cost was for geocoding API. How can I get data on what this cost is made up of (e.g. service, domain, source IP … anything to identify how to drive down cost).

Besides the vendor location map is there anything else that uses this service in a default multivendor ultimate instalation?

How are people reducing their cost?

are you using the free allocation, around 10,000 ?

yes on default with free 10k.

1 Like

The Maps and geolocation add-on uses it as well.

1 Like

last couple of months getting hit with 200.00 + bill for geolocation API.
Is there a way to limit it just to the backend?

You can try removing all the Maps and geolocation and Vendor location add-ons blocks from the theme’s layout pages.

I disabled the Customer location block that was in the default layout, waiting for next billing with fingers crossed.

1 Like

well that did not make much difference, google just nailed me 299.60 for google cloud service.
Any have pointers where to trim it down? is it just geolocation or is captcha also in the bill. google is no help in displaying a breakdown of the costs (at least I can t find it)

ok. this is scary.

apparently maps API key is also used for gemini and bad acters use your key and you can be charged thousands in minutes.

I wondered maybe if your key has been grabbed, might be worth rotating your keys.

@CS-Cart_team do any of the bundled/cs-cart developed addons publicly expose keys (as discussed in the article)?

Hi!

CS-Cart only reveals the public key on the store’s pages. This key should be protected from unauthorised usage on Google’s side, where a list of domains permitted to use it should be set up.

What can be misused by the bots and crawlers, is the requests to the Geolocation Google Maps API made directly from the store. We have already developed an improvement to this situation for the next release: Geolocation scripts will be completely hidden from visitors with a plain bot/crawler browser user agent. Please replace this code:

{$provider = $settings.geo_maps.general.provider}

{if $provider == "yandex"}
    {script src="js/addons/geo_maps/provider/yandex/index.js" cookie-name="yandex_maps"}
    {script src="js/addons/geo_maps/provider/yandex/maps.js" cookie-name="yandex_maps"}
    {script src="js/addons/geo_maps/provider/yandex/code.js" cookie-name="yandex_maps"}
    {script src="js/addons/geo_maps/provider/yandex/locate.js" cookie-name="yandex_maps"}
{elseif $provider == "google"}
    {script src="js/addons/geo_maps/provider/google/index.js" cookie-name="google_maps"}
    {script src="js/addons/geo_maps/provider/google/maps.js" cookie-name="google_maps"}
    {script src="js/addons/geo_maps/provider/google/code.js" cookie-name="google_maps"}
    {script src="js/addons/geo_maps/provider/google/locate.js" cookie-name="google_maps"}
{/if}

with this code:

{$provider = $settings.geo_maps.general.provider}
{if (!defined("NO_SESSION")) && (!defined("CRAWLER"))}
    {if $provider == "yandex"}
        {script src="js/addons/geo_maps/provider/yandex/index.js" cookie-name="yandex_maps"}
        {script src="js/addons/geo_maps/provider/yandex/maps.js" cookie-name="yandex_maps"}
        {script src="js/addons/geo_maps/provider/yandex/code.js" cookie-name="yandex_maps"}
        {script src="js/addons/geo_maps/provider/yandex/locate.js" cookie-name="yandex_maps"}
    {elseif $provider == "google"}
        {script src="js/addons/geo_maps/provider/google/index.js" cookie-name="google_maps"}
        {script src="js/addons/geo_maps/provider/google/maps.js" cookie-name="google_maps"}
        {script src="js/addons/geo_maps/provider/google/code.js" cookie-name="google_maps"}
        {script src="js/addons/geo_maps/provider/google/locate.js" cookie-name="google_maps"}
    {/if}
{/if}

in design/backend/templates/addons/geo_maps/components/scripts.tpl file to add the additional layer of protection, besides usage limits and billing alerts on the Google’s side.

2 Likes

I have developed a add on to reduce the cost, fantastic results! I am yet to set up a marketplace store on cs-cart marketplace but that is coming.

If you want to know more, get a copy, see this topic.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.