Tagged: , ,

Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #991907

    Hi there,
    does anyone understand how the APIs and the billing account work together?
    I mean, i created an API, for maps javascript and geocoding, then put the API into the enfold theme.
    Also i created a billing account and linked to the project of the api’s and put my credit card info in it.
    the map works, but i’m afraid of the quota “unlimited”.
    Does anyone really understood how they calculate the “loads” and how to setup a safe quota for not being billed?
    i tried to put for the JavaScript api:
    Map loads per day 900
    Map loads per 100 seconds 50
    Map loads per 100 seconds per user 10

    the maps already set into pages works, but when i insert a new map the theme says “too much requests in a short time range, please wait some minutes and retry”
    I guess this is relative to the Geocoding api (translate address into coordinates) but can’t understand if this happen only when i insert a new map into a new page or every time the page load for a user who visit the website.

    Can some one help me and other people who are stocked into this?
    Thank you.

    #992303

    Hey marco3253,

    Thank you for using Enfold.

    This is the new pricing for each API.

    https://cloud.google.com/maps-platform/pricing/sheet/

    You’re only concern when using the theme’s map element is the Dynamic Maps and the Geocoding API. They are free up to 28,000 loads and 40,000 calls per month, respectively. Please note that theme calls the Geocoding API only when it has to validate the map API key and when fetching the map coordinates. You’ll be billed extra when there are more than 28,000 requests for the Dynamic Map API or when your visitors visited the pages with the map element more than 28,000 times.

    Best regards,
    Ismael

    #992355

    Hi Ismael, thank you for your answer.

    As I understood, the enfold theme use two kind of API, geocoding and JavaScript Map API.
    in this moment i set up the quota in this way:
    Map loads per day 900
    Map loads per 100 seconds 50
    Map loads per 100 seconds per user 10

    is this a safe way to keep the service free? (900 *31 days = 27900)

    and the geocoding
    Map loads per day 1200
    Map loads per 100 seconds 50
    Map loads per 100 seconds per user 10
    (1200 * 31days = 37200)

    Now the only problem is when i add new “google map” element into a page, it says “to many request together, please try later”
    But i did not reach 1200 (or 900) calls for today, now is giving me the error on the fist page i want to create with a map, so i really don’t understand why i’m out of the quota, can you advice two safe quota for the relative APIs to set up?

    #992649

    Hey!

    Yes, that daily limit is enough to keep you within the free usage quota. Make sure that it is also within the daily traffic of your site. If there are more than 900 daily visitors in the site, some of them won’t be able to see the map.

    Map loads per 100 seconds 50

    I didn’t know that you can adjust the requests rate per second. If I am not mistaken, the limit above means that you can only send a request every 2 seconds. You should set it to at least 10 QPS or 10 map loads per second to make sure that you don’t exceed the usage limit.

    // https://developers.google.com/maps/premium/previous-licenses/articles/usage-limits

    Can you send us a screenshot of your API usage limit?

    Cheers!
    Ismael

    • This reply was modified 5 years, 10 months ago by Ismael.
    #992784

    Hi Ismael, i set up to 10 (map loads per 100 seconds) but when i tried to add map it always says “too much requests, please wait” so i had to set 50.
    I really can’t understand how this works, i mean, when i put a new map, i set up the address then i click “obtain coordinates” in that moment which api is called and how many times in how many seconds? i guess it’s the geocoding one, in fact i had to set up the quota to “5000 request per 100 seconds”. I mean, only who is editing the website is able to put a new map in a page, and that means that only who is editing the website is able to call the geocoding api right? in this case i can be more comfortable with the quota because i can control the editing of the website.

    I’m just afraid of what i cannot control, that means api called by users who visit the website (what about crawler, ddos, attacks and other we don’t know how the count is made), this api should be only javascript map api, i guess and hope.

    Also, can i ask you why don’t you think to set up in Avia builder a map element who calls “static map api” witch is unlimited for calls? why enfold calls javascript api, is there a specific reason for that?

    i’m making you a video and upload on youtube to show you some issues and doubts.
    Thank you for this exchange of informations.

    Marco

    #992808

    This is a video showing how on a website, nevertheless the api key is correct, the map is not working.

    VIDEO

    These are the settings of the quota of this api key shown in the video: https://we.tl/azAxVBcoEZ
    I even did not set the quota, it’s unlimited, and is not working.

    on the javascript console says “DeletedApiProjectMapError” but the api project is alive and working.
    ALSO, i tried to disable the apis, both, and re enabling, also i tried to delete the entire project on google console and did it again, recreate the api, re enabled the two apis, nothing works.
    I also re uploaded all the enfold theme overwriting the folder, but is not working.

    #993138

    Hi,

    Thanks for the update.

    I set up to 10 (map loads per 100 seconds)

    Now, you’re limiting it to 1 request every 10 seconds. My recommendation is to set it to 10 requests per second. That’s 1000 requests per 100 seconds.

    The theme is using the dynamic map API because it has more options compare to the embedded map. Please refer to the API documentation if you want to know the difference.

    The “DeletedApiProjectMapError” error means that you’re using an API key from a deleted project. Are you sure that you regenerate the key after you created the project?

    Have you read the documentation?

    // https://kriesi.at/documentation/enfold/google-map/

    Best regards,
    Ismael

    #993230

    Hi Ismael,

    i manage like 4 websites, all got the same problem because they had not got the api key, so i make the process of creating 4 projects, create 1 billing account, linked the 4 projects to the billing account and then created 4 api keys with restrictions also (this one is not working is temporary without restriction just to make it work first) and enabling only geocoding and javascript for each projects.
    So i guess now i’m pretty comfortable with the best practice to make them work and troubleshooting. Also as i wrote i deleted the project who wasn’t working and remade again, new api key etc. but i was not lucky.
    The api key test into enfold theme is working, it says that it’s able to connect, then i’m not able to obtain the coordinates..this is strange because with other projects if there were problems the api key tester stopped me at the first try.

    #993795

    Hi,

    Thanks for the update.

    Can I have access to one of the sites where the API key is not working? You should add http referrers to restrict the usage of the API key because it is visible on the frontend, and it might be used to load maps for other websites.

    Best regards,
    Ismael

    #994024

    Hi Ismael,
    the key is not restricted yet because of this problem, as suggested on the enfold documentation too, it’s better to make it work without restriction then you can add and try again.
    this is a governative website, i will feel more comfortable if we can do like a teamviewer session with the chat. let me know what you think.

    Marco

    #994186

    Hi,

    I’m sorry but we don’t do that here. Did you create a staging or a dev site?

    Best regards,
    Ismael

    #994765

    Ok Ismael, here are the infos:

    #995290

    Hi,

    Thanks for the update.

    I get the same error on the front and back end.

    Google Maps JavaScript API error: DeletedApiProjectMapError
    https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-error
    

    More info about the error:
    // https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-error

    You can start creating a project with the correct APIs here:
    // https://developers.google.com/maps/documentation/javascript/get-api-key

    That API key is from a project that was previously deleted. You need to access the current project, generate a new key, set https restrictions using wild cards and then put that key in the theme options.

    Best regards,
    Ismael

    #995870

    Hi Ismael, thank you for your time.
    As previously understood by myself, and thanks to the google’s documentation, that error means “project deleted”.

    But the project is alive, it has the API assigned, and it has the two apis that we need active, all is the same compared to other working projects.

    Also, i tried already to delete the project, make new project, make new key, try and the result is the same.
    The strange fact is that when i verify the key, enfold tells me that everything is OK. so the key is correct and alive, and i haven’t set quota for now i do need to make it work first. when i try to add the map enfold says “something is wrong maybe you misspelled the domain restriction in the api key configuration” but actually there are no restrictions, because i need to make it work first, then i will add restrictions.

    now i generated another key for the same project. pasted to enfold it says “alright sparky” try to add the map and got the same error. this is pretty strange.

    #995874

    Hi,

    Yes, that’s weird. Please try to contact the Google support. Ask them why the API returns a “deleted project” error even though the API key was generated from a live project.

    Best regards,
    Ismael

    #997902

    Hi Ismael,

    after contacting google support maybe we find whats’ wrong.
    It looks like the website is contacting google with a cached api key and not the one i’m saving into the options. that’s why i got that deleted project error.

    here’s what they wrote:
    “Hello Marco,

    After checking your website it looks like your Theme implementation is not adding the script with the correct api key.

    Unfortunately, Third-party plugins are a blackbox for us, we cannot really see why is not including the api key in your code, so I won’t be able to help further. Please file an issue in the your theme support forums, they will be able to help you find what is correct way to implement Maps Javascript API through the plugin.

    As much as I would like to, I cannot help further as we can not access the internals of your websites or the theme’s implementation (and are not authorized to do so anyway.)

    Attached I send you an image where you can see that in your website the script that load the api is still using the other key. I would suggest to edit the api key in your HTML code directly and no through the plugin.

    In the meantime if you have remaining questions about the Maps Platform feel free to ask and I’ll be happy to answer them.

    Wishing you a great day.”

    it looks like there is the old api cached somewhere in the website, how can i push the new api into the settings overwriting old settings?

    thank you

    #998230

    Hi,

    Thanks for the update.

    The theme doesn’t cache or store the API key in the database. If it does, it’s going to be saved as a transient data. However, I found a map filter in your functions.php file that is using the old API key so I disabled it. The map displays properly now.

    function ava_googlemaps_apikey() {
    	$prefix  = is_ssl() ? "https" : "http";
            wp_deregister_script('avia-google-maps-api');
    	wp_register_script( 'avia-google-maps-api', $prefix.'://maps.google.com/maps/api/js?key=OLD API KEY HERE', array('jquery'), '3', true);
    	wp_enqueue_script('avia-google-maps-api');
    }
    add_action('init', 'ava_googlemaps_apikey');
    

    Best regards,
    Ismael

    #998348

    Ismael thank you for your time, i don’t know why that code was there, maybe some old old try or some other colleague that worked on that time ago.

    Removed that code all is working as it should be. Thank you very much for your time.

    Marco

    #998430

    Hi marco3253,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 19 posts - 1 through 19 (of 19 total)
  • You must be logged in to reply to this topic.