ResolvedGoogle API Doesnt seem to work.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #36061
    anchitkawaatra
    Participant

    Hi Team, please check Ethigreenz.com.

    Google Api i setup, billing account seems to be reducing money for confirmation but doesn’t seem activated. I have raised a support ticket there but not sure whom to contact for this.

    After entering API in the lafta shipping settings and whitelisting my cloudways server IP. I get the GEOCODE error – Geocoder failed due to: MapsRequestError: GEOCODER_GEOCODE: REQUEST_DENIED: The webpage is not allowed to use the geocoder.

    Have been at this for 2 days. I cant even set a branch location because of this. How can i solve this please reply.

    #36066
    anchitkawaatra
    Participant

    Found my solution on my own.

    #36074
    Althemist
    Keymaster

    Hi anchitkawaatra,

    Glad you managed to find the problem. BAsically, you can’t whitelist an IP. It must be explicitly specified domain, not IP.

    #36080
    anchitkawaatra
    Participant

    Hi, Where do I whitelist the domain specifically? Google says i should restrict the API Key. But in your theme options – shipping area, it asks for secondary API if 1st is restricted. Where can i solve both the issues together so misuse is also prevented?

    #36096
    Althemist
    Keymaster

    Yes, you must have 2 API keys. The firs one must be restricted for your domain. The second one should not be restricted. It’s explained below each API key field. The API keys settings can be done in the Google API, not on on your site.

    #36109
    anchitkawaatra
    Participant

    Thank you for your reply.

    So I made another API key, restrcited to just that Distance Matrix API. Other original API I restrcited to first the *.example.com/* format as given. Map stopped working. Distance was being calculated but no map and location could not be selected.

    Then i removed that and add server IP restrcition and removed the domain name one. Still the same. It works only when 1st is not restrcited at all.

    #36116
    Althemist
    Keymaster

    1. The first key must have the following APIs enabled: Places API, Geocoding API, Distance Matrix API AND it must have HTTP referrer set to your domain.

    2. The second key must have the Distance Matrix API and NO restrictions

    #36119
    anchitkawaatra
    Participant

    Hi, Thank you for your email.

    I have done exactly that. Let me elaborate that here. Please check my website after this – i have kept at these settings –

    Enabled all APIs. Linked billing account.
    Created Credentials > API. Application Restrcitions for 1st Key => HTTP referrer in following format – *.ethigreenz.com/* and saved it.
    No restrcit at bottom radio selection. Saved this. used the API Key as KEY 1 in Lafka Theme Shipping settings general tab. Key in Google console shows green, before restricting the referrer it was yellow warning sign.

    Created another AP credentials key, no application restriction, but selected restrict and selected Distance Matrix API. and saved. Put this api key in API key 2 in general tab as above.

    Now check the website. – Select any cake – go to checkout – map doesnt work.

    Shipping 3 methods I have made 0-6km, 6-11km, 11-16km. with minimum order of 400, 800 and 1200 respectively and delivery charge as 10 times the distance.

    Please check this. Atleast this will be sorted.

    #36128
    Althemist
    Keymaster

    Actually, it is easy to see your site (referrer) is not authorized. Probably wrong settings in the API key configuration. This is from your site’s console:

    Google Maps JavaScript API error: RefererNotAllowedMapError
    https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
    Your site URL to be authorized: https://ethigreenz.com/

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register