Updating Your Site's Content Security Policy for Google Maps JavaScript API

Updating Your Site's Content Security Policy for Google Maps JavaScript API

Introduction

As a website owner or developer, it's essential to stay up-to-date with the latest changes and updates to the Google Maps API. With the decommissioning of version 3.49 of the Google Maps JavaScript API in Q2 2023, it is now necessary to update your site's Content Security Policy (CSP) to maintain uninterrupted access to the API. This article will guide you through the process of updating your CSP to allow-list googleapis.com, ensuring continued support and optimal performance for your website or web app.

What You Need to Know

The Maps JavaScript API will no longer support CSP directives that do not specify googleapis.com after version 3.49 is decommissioned. While allowing maps.googleapis.com may work temporarily, it will not be sufficient in the future. To maintain a seamless experience for your users, you must authorize googleapis.com in your CSP instead.

What You Need to Do

If your site does not have a CSP or already has googleapis.com correctly allow-listed, no changes are required. However, if you need to update your CSP to include googleapis.com, follow these steps:
  1. Review the Content Security Policy guide for the Maps JavaScript API to understand the technical requirements and best practices.
  2. Visit the Content Security Policy main site for more information and help regarding CSP implementation and updates.
  3. Update your site's CSP to allow-list googleapis.com at your earliest convenience, regardless of the Maps JavaScript API version currently in use.
Version Schedule and Updating
Version 3.50 of the Maps JavaScript API was loaded into the weekly channel beginning August 2022 and into the quarterly channel beginning November 2022. If you need more time to update your CSP, ensure you specify v=3.49 before these dates to continue receiving support until the decommissioning in April 2023.

After updating your CSP, you can return to specifying v=weekly or v=quarterly for your API version. For more information about specifying channels and versions, consult the Maps JavaScript API versioning guide from Google.

A technical guide and relevant details are available at the Content Security Policy guide for Maps JavaScript API. More information and help regarding CSP can also be found at the Content Security Policy main site.

Conclusion

Staying updated with API changes is crucial for providing the best possible experience for your website or web app users. By updating your site's CSP to allow-list googleapis.com, you can ensure continued access to the Maps JavaScript API and maintain a smooth experience for your users. Act now to make the necessary changes before the decommissioning of version 3.49 in Q2 2023.

    • Related Articles

    • Buy Now API Guide

      The following guide is aimed at assisting developers in understanding how the omacro Buy Now services work in an effort to develop a custom front-end solution. If you are not familiar with this type of development, it is highly recommended that you ...
    • Track Buy Now Activity With Google Analytics

      Introduction Buy Now can be used with 3rd-party analytics tools like Google Analytics to target specific URL parameters. Gain precise insights into how customers engage with Buy Now. This article will outline the basics of product seller link URL and ...
    • Embedding Dealer Locator Within Website Page

      You can embed the locator directly on to a page. Assuming you have gone through the steps of adding omacro's buy now code snippets to your page, use the following example to render the locator within the page itself. To see a live demonstration, ...
    • Request Failure Report

      Request Failure Report Error Codes & Usage Introduction When you encounter failures with the 'Buy Now' web service, the system provides distinct messages to help you troubleshoot. These messages can indicate issues with a product page setup or ...
    • Distributor Locator Website Code Implementation

      Step 1: Include script within website The example below demonstrates what's needed to integrate the Distributor Locator widget with your site. Simply update desired parameters then copy the snippet into your website. <script id="omacro-widget-buynow" ...