HubSpot for WordPress
Google Maps API server rejected your request (5 posts)

  1. John
    Posted 2 years ago #

    After recently installing 1.7 of the plugin, I started getting the following pop-up warning window in the browser when visiting my site:

    The google maps api server rejected your request. The "Sensor" parameter specified in the request must be set to either "true" or "false".

    I was able to track it down to wp-content/plugins/hubspot/inc/hs-contact.php. On line 26 it reads:

    function hs_contact_scripts() {
    wp_enqueue_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=true');

    Commenting this out with a "//" resolved the error.

    What functionality does this provide? What am I going to miss out on with tracking with this commented out?

    According to the google API docs, it states the following format should be used:


    With the API_KEY being your google apps api. Do I need to set up a google apps api for this functionality to work?

    What needs to be done in order to be able to uncomment this line and have the unknown functionality enabled?


  2. John
    Posted 2 years ago #

    I updated the plugin to 1.8.2 and still I am getting this error on EVERY page load. Absolutely frustrating...

    I had to go back and re-implement the above work-around to rectify.

    As a paying member for Hubspot, I called support. The canned answer is to take it up on the forums. <priceless>

  3. webbwow
    Posted 2 years ago #

    This worked for me {using a different theme}.

    Go to Appearance > Editor > Theme Functions (functions.php)

    Find: wp_enqueue_script( 'googleapis', 'http://maps.googleapis.com/maps/api/js?v=3&sensor=true');

    Replace with: wp_enqueue_script( 'googleapis', 'https://maps.googleapis.com/maps/api/js?sensor=false');

    From what I understand, this is related to the Map located on most contact pages.

  4. mdlepage
    Posted 2 years ago #

    webbwow's fix should be implemented.

    I have SSL on my site and because the google maps api is enqueued as http: I keep getting "Display unsecure content" messages for all of my users.

    Perhaps this should be
    wp_enqueue_script( 'googleapis', '//maps.googleapis.com/maps/api/js?sensor=false');
    which will then apply http or https depending on if the site has SSL or not.

  5. qotp1129
    Posted 1 year ago #

    I didn't have this issue until I installed Eventbrite plugin. I've uninstalled the plugin; however, I continue to receive this error message. I have checked the theme's function.php file and searched for the code you provided; however, there isn't such code listed. How do I clear this error message when I don't have an active plugin? Is there another .php file I should search?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic