Toggle the One Tap display with cookies

In dynamically generated HTML pages, you're able to include the g_id_onload ID when the login is required and remove it after a user session is established. However, to toggle the One Tap display for your static HTML pages, you can't change the HTML content.

The way that you can set up One Tap to toggle its display status is to specify a cookie with the data-skip_prompt_cookie attribute. If the cookie isn't set, or the value is empty, our client library functions normally. Otherwise, the client library stops running and One Tap isn't displayed.

You can set your cookie name with the following code snippet:

<div id="g_id_onload"