How to Enable Third-party Cookies in Google Chrome

The newer versions of Google Chrome block third-party cookies by default. Cookies are considered “bad” as they are mostly used for tracking users on the Internet but some cookies serve a useful purpose as well.

For instance, a GSuite add-on may open a small sidebar inside Google Sheets and this sidebar may need to communicate with other windows that are opened by the same add-on. Since the windows are on different domains, the only way for them to communicate with each other is through third-party cookies.

This video explains why some third-party cookies are necessary and how you can selectively allow cookies inside Google Chrome.

GSuite add-ons including Document Studio, Form Notifications and Mail Merge require you to enable third-party cookies in your browser to save user preferences and settings.

Allow Third-party Cookies for GSuite

Here are step-by-step instructions on how to enable third-party cookies in your Google Chrome browser. This will only allow cookies for GSuite add-ons in Google Sheets, Form, Docs, and Google Sides.

Step 1: Open Google Chrome browser, click the settings menu in the top right (3 vertical dots).

chrome settings menu

Step 2: Click the “Privacy and Security” option in the settings pane.

Settings Privacy

Step 3: Expand the “Cookies and other site data” section under the Privacy and Security page.

Block Third-party cookies

Step 4: The “Block third-party cookies” setting should be selected to continue blocking all cookies except those served by GSuite add-ons.

GSuite addon cookies

Step 5: Click the “Add” button under the section that says “Sites that can always use cookies” and enter the domain https://[*.]googleusercontent.com in the input box.

allow third party cookies

Click the “Add” button, reload your Google Form or Google Sheet and the addon will continue to work as before.

How to Download Speaker Notes in Google Slides

With Creator Studio, you can easily convert your Google Slides presentation into animated GIFs and video slideshows. The add-on can also extract speaker notes from your slides and export them as a text file in Google Drive.

Download Speaker Notes in Google Slides

To get started, open your deck in Google Slides, go to the Addons menu and choose Creator Studio. Next, select the Speaker Notes menu and you’ll see just the speaker notes of all slides in a popup window that you can download and print.

How are Speaker Notes Generated

Internally, the app uses Google Apps Script to export Speaker Notes from your Google presentation and writes them to a text file inside Google Drive.

const downloadSpeakerNotes = () => {
  // Get the current Google Slide
  const presentation = SlidesApp.getActivePresentation();

  // Find all the slides in the current presentation
  const slides = presentation.getSlides();

  // Iterate through each slide and extract the notes
  const notes = slides
    .map((slide, index) => {
      const note = slide
        .getNotesPage()
        .getSpeakerNotesShape()
        .getText()
        .asString();
      return { index, note };
    })
    // Filter slides that have no speaker notes
    .filter(({ note }) => note)
    .map(({ note, index }) => {
      return [`Slide #${index + 1}`, '---', note].join('\n');
    })
    .join('\n');

  // Create a file in Google Drive for storing notes
  const file = DriveApp.createFile('Speaker Notes', notes);

  // Print the file download URL in the Logger window
  Logger.log(file.getDownloadUrl());
};

Export Speaker Notes PDF in Google Slides

Google Slides has a built-in option for exporting your slides as a PDF file and this can be configured to also include the speaker notes.

Open your deck in Google Slides, go to the File menu and choose Print Settings and Preview. Here choose the “1 slide with note” option and click the “Download PDF” button to export your speaker notes as PDF.

It just works but the only downside with this approach is that it generates a bloated PDF that isn’t perfect for printing. Also, the slides are always includd with the speakers notes in the PDF, there’s currently no option to save the speaker notes only.

Speaker Notes as PDF

The 10 Useful Networking Commands You Should Know

What is my IP address? Who is the host of this website? Which mail service is this domain using? There exist web tools that can uncover these details but this sort of research can also be done using the command line on your computer.

Network Commands

Let’s explore a few essential networking commands that will help you know everything about a website from the terminal itself.

What is my IP address

curl https://checkip.amazonaws.com

Make a curl or wget request to the checkip.amazonaws.com and it prints the public IP address of your computer. You can also connect to Akamai’s whatismyip.akamai.com domain get your external IP address.

What is my Private IP address

ifconfig en0 | grep inet

Your computer has a private IP address that only work within the local network. For older Macs with a wired Ethernet port, use en0 for Ethernet interface or en1 for the WiFi interface. The networksetup -listnetworkserviceorder command will print a list all network interfaces available on your machine.

Find the Location of IP address

curl https://ip2c.org/?ip=8.8.8.8

The free ‘ip2c’ service resolves an IP address to the country.

Or use the ‘ipapi’ service to get more details of an IP address including the city name, timezone and even the latitude and longitude associated with an IP address.

curl https://ipapi.co/8.8.8.8/json

Check DNS Records

The dig command will help you query for any type of DNS records for a domain from the command line.

1. Find the IP address of a website

dig +short www.labnol.org

2. Find the Mail Server of Domain

The Mail Exchange (MX) records specify the incoming mail servers that used for delivering email messages sent to your domain name.

host -t MX labnol.org

3. Print all DNS Records of a Domain

Get a list of all DNS records of a domain including TXT records, MX records and name servers. The name servers handle queries regarding the location of the domain’s website, email and other services.

dig +nocmd amazon.com any +noall +answer

Who is hosting a website?

Use the dig command to find the IP address of a website and then use the same dig command to perform a reverse lookup to find the host of that IP address.

For instance, this command will print the IP address of the Netflix website:

dig +short netflix.com A | tail -1

Use that IP address in the next command to get the hostname:

dig +nocmd -x 52.11.104.17 +noall +answer

Find the owner of the website

Use the built-in whois command to reveal important information about any web domain including the date when it was first registered, the contact details of the website owner, the expiration date of the domain, the name of the domain registrar and so on.

whois dictation.io

You can also query the domain registration details on a specific registrar’s server with the -h flag. For instance, the next command performs a whois lookup on a website using the WHOIS server of Google Domains.

whois -h whois.google.com reverse.photos

Test Network Connectivity with Ping

The ping command helps you test if a remote host is reachable and whether your machine can connect to it properly.

ping -c 5 -i 2 labnol.org

The above command pings the host 5 time and there’s a 2 second wait between pings.

Where’s the fault?

If your Internet connection is working but you are unable to reach a website, there could be an issue with an intermediate router that the packets have to pass through to reach the server.

The traceroute commands prints the network path from your local computer to the website that the traffic must pass through and this information can be useful for diagnosing connectivity issues.

traceroute labnol.org

Also see: Essential Tools for Developers

How to Add Options in Google Forms Questions from Google Sheets

A school is trying to create a Google Form where students can register their details. The form would have a drop-down of countries, the names of class teachers as a multiple choice question and a checkbox style question where students can pick one or more subjects.

It is easy to create such a form inside Google Forms - here’s a sample form - but there are two issues:

  1. There’s too much data to type. For instance, the country down-down alone has a list of 250 countries and it would take some work for the form editor to manually type each choice in the question.
  2. The question choices in the form may change with time. In the previous example, some teachers may move out, new teachers may join in and the drop-down list in the form has to be updated manually every time there’s a change in the staff.

Auto-Populate Questions in Google Forms with Google Sheets

As with everything else in the world of Google Forms and Google Sheets, we can easily automate the process of adding question choices in Google Forms in bulk with the help of, you guessed it right, Google Apps Script.

The idea is simple. We’ll have a Google Sheet that will be the data source and have all the answer choices for various questions in the Google Form.

The app will read the data from this Google Sheet and auto-populate the choices in the form with one click. You can even create a time-trigger that runs every hour, day or month to dynamically update your form using the most current data available in the spreadsheet.

Add Options in Dropdown Lists & Multiple Choice Questions

Create a Google Spreadsheet and add the question titles in the first row of the sheet, one per column. Next, write down all the options or choices that should be available per question.

Here’s how your spreadsheet structure would look like:

Google Form Answers in Google sheets

The important thing to note here is that your column headings in the spreadsheet should exactly match the form field labels of the Google Form. The Google Script can bulk add answers in multiple-choice questions with a single answer, drop-down lists and checkbox with multiple options.

Bulk Add Question Choices with Google Script

Open the Google Sheet that has the question choices, go to the Tools menu and choose Script Editor. Replace the default code in the script editor with the Google Script below. Please watch the video tutorial to know in more detail how this code works.

/**
 * Auto-populate Question options in Google Forms
 * from values in Google Spreadsheet
 *
 * Written by Amit Agarwal (MIT License)
 *
 **/

const populateGoogleForms = () => {
  const GOOGLE_SHEET_NAME = '<<Put the name of Google sheet here>>';
  const GOOGLE_FORM_ID = '<<Put your Google Form ID here>>';

  const ss = SpreadsheetApp.getActiveSpreadsheet();

  const [header, ...data] = ss
    .getSheetByName(GOOGLE_SHEET_NAME)
    .getDataRange()
    .getDisplayValues();

  const choices = {};
  header.forEach((title, i) => {
    choices[title] = data.map((d) => d[i]).filter((e) => e);
  });

  FormApp.openById(GOOGLE_FORM_ID)
    .getItems()
    .map((item) => ({
      item,
      values: choices[item.getTitle()],
    }))
    .filter((values) => values)
    .forEach(({ item, values }) => {
      switch (item.getType()) {
        case FormApp.ItemType.CHECKBOX:
          item.asCheckboxItem().setChoiceValues(values);
          break;
        case FormApp.ItemType.LIST:
          item.asListItem().setChoiceValues(values);
          break;
        case FormApp.ItemType.MULTIPLE_CHOICE:
          item.asMultipleChoiceItem().setChoiceValues(values);
          break;
        default:
        // ignore item
      }
    });
  ss.toast('Google Form Updated !!');
};

You need to replace the GOOGLE_SHEET_NAME and the GOOGLE_FORM_ID with your own values. Go to the Run menu inside the Script editor, choose populateGoogleForms function and it should instantly choices for all the specified questions in the Google Form.

Dynamically Update Answers in Google Forms

Going forward, whenever you need to update the answer choices in Google Forms, you can simply update the values inside the spreadsheet and run the same auto-populate function from the Script editor.

Or, to make things even more simple, you can add a button on the spreadsheet page that, when clicked, will automatically update the answers in Google Forms for you.

Go to the Insert menu in Google Sheets, choose drawing and pick any shape. You can also add overlay text to the shape. Once the shape is placed on the spreadsheet canvas, click the menu, choose assign script and type populateGoogleForms.

Bulk Import Button in Google Sheets

That’s it. You can click this button to update your Google Forms right within Google sheets. Do note that the script will not append choices, it will replace all existing choices with the ones that are available in your Google Sheet.

Also see: Send Pre-filled Google Forms via Email

How to Create Zoom Meetings with Google Script

This guide describes how you can programmatically create user meetings in your Zoom account with the help of Google Apps Script and the official Zoom API.

As a first step, go to the Zoom Developer Dashboard and create a new app. Choose JWT as the app type and make a note of the Zoom API key and secret. We can build Zoom apps with the OAuth2 library as well but since this app is only for internal use and will not be publish to the Zoom marketplace, the JWT approach is easier.

Create Zoom App

The app would involve two step. We’ll connect to the /api.zoom.us/v2/users/ API to get the Zoom ID of current authenticated user. Next, we make a POST request to the /v2/users/<<ZoomUserId>>/meetings endpoint to create the actual Zoom meeting.

The app can be enhanced to automatically add new participants to a meeting after they register their email address on, say, Google Forms. In that case, a POST request is made to /meetings/{meetingId}/registrants with the email address and first name of the participant in the request body.

Generate the Zoom Access Token

const ZOOM_API_KEY = '<Your Zoom key here>>';
const ZOOM_API_SECRET = '<Your Zoom secret here>';
const ZOOM_EMAIL = '<Your Zoom account email here>';

const getZoomAccessToken = () => {
  const encode = (text) => Utilities.base64Encode(text).replace(/=+$/, '');
  const header = { alg: 'HS256', typ: 'JWT' };
  const encodedHeader = encode(JSON.stringify(header));
  const payload = {
    iss: ZOOM_API_KEY,
    exp: Date.now() + 3600,
  };
  const encodedPayload = encode(JSON.stringify(payload));
  const toSign = `${encodedHeader}.${encodedPayload}`;
  const signature = encode(
    Utilities.computeHmacSha256Signature(toSign, ZOOM_API_SECRET)
  );
  return `${toSign}.${signature}`;
};

Get the Internal User Id of the current user

const getZoomUserId = () => {
  const request = UrlFetchApp.fetch('https://api.zoom.us/v2/users/', {
    method: 'GET',
    contentType: 'application/json',
    headers: { Authorization: `Bearer ${getZoomAccessToken()}` },
  });
  const { users } = JSON.parse(request.getContentText());
  const [{ id } = {}] = users.filter(({ email }) => email === ZOOM_EMAIL);
  return id;
};

Schedule Zoom Meeting

You can create an Instant meeting or schedule a meeting with a fixed duration. The meeting start time is specified in yyyy-MM-ddThh:mm:ss format with the specified timezone.

The complete list of meeting options is available here while the timezones are available here.

const createZoomMeeting = () => {
  const meetingOptions = {
    topic: 'Zoom Meeting created with Google Script',
    type: 1,
    start_time: '2020-07-30T10:45:00',
    duration: 30,
    timezone: 'America/New_York',
    password: 'labnol',
    agenda: 'Discuss the product launch',
    settings: {
      auto_recording: 'none',
      mute_upon_entry: true,
    },
  };

  const request = UrlFetchApp.fetch(
    `https://api.zoom.us/v2/users/${getZoomUserId()}/meetings`,
    {
      method: 'POST',
      contentType: 'application/json',
      headers: { Authorization: `Bearer ${getZoomAccessToken()}` },
      payload: JSON.stringify(meetingOptions),
    }
  );
  const { join_url, id } = JSON.parse(request.getContentText());
  Logger.log(`Zoom meeting ${id} created`, join_url);
};

How to Use Conditional Fields in Email Templates

The Mail Merge and Document Studio add-ons let you send personalized emails with the help of template markers.

The markers automatically create a mapping between the column names in the Google Sheet and the variable fields in your email message. When the email is sent, the marker fields in the email message are replaced with the values from the respective columns of the sheet.

Let’s say you have a column titled First Name in your Google Sheet and your email message body has a marker that says Dear {{First Name}}, (also notice the comma in the end).

Template Fields in Mail Merge

Fill-in Fields

If your Google Sheet rows has a value, say Alex, the text in the email message would read Dear Alex,. However, if the first name is not available for a particular row, the variable field would be replaced with a blank value and this first line in the email message would thus read Dear <space>, - something that you should totally avoid in personalized emails.

There are two ways to deal with this issue. You can either clean up your data before running merge, or you can use formulas in Google Sheets to offer an alternate value in case the original field doesn’t have a value. Let me explain:

  1. Add a new column in the Google Sheet title “Greeting”

  2. Add a formula in row #2 of the Greeting column.

=IF(ISBLANK(A2),"Hello",CONCATENATE("Dear", " ", A2))

The formula basically looks at the Name column, it is blank, the greeting is set to “Hello” else it uses the default “Hello FirstName” value.

  1. Now edit your email template and replace “Dear {{Name}},” with “{{Greeting}},“.

You can either copy-paste the formula in the remaining cells of the column manually or use the ArrayFormula function to copy it down for you.

If..Then..Else

The technique can be extended to add more customization to your email message. For instance, you may choose a different greeting in your email subject based on the country of the recipient.

Email Greetings

If the country is in column B, the Greeting formula would be:

=IFNA(
  IFS(
   B2 = "USA", "Hello",
   B2 = "Spain", "Hola",
   B2 = "India", "Namaste"
  ), "Greetings")

Calculated Fields

The templates fields in the email message are dumb and merely get replaced by values in the Google Sheet. If you wish to include any logic or calculations in the template fields, it should be done in the sheet itself.

Let me give you another example.

Conditional Fields in Mail Merge

The Google Sheet records the invoice details and sends email reminders for payments. Using the magic of Google Sheet formulas and template markers, the text of the email message can be dynamically changed based on when the invoice is due. If the due date has already passed, we send a different message.

First add a new column (say, Days Left) that calculates the number days between now and the invoice due date. Add this formula in row #2 of the column. It will only fill values when the due date is available.

=ArrayFormula(IF(ISBLANK(C2:C),"", ROUND(C2:C-TODAY())))

Add a new “Invoice Status” column and again use the ArrayFormula function to get the text for the email message body and subject.

=ArrayFormula(
  IF(ISBLANK(C2:C), "" ,
     IF(D2:D>0, CONCAT("due on ",TEXT(C2:C,"mmmm dd, yyyy")),
                CONCAT(ABS(D2:D)," days past due"))))

See more Google Sheets solutions.

How to Use Hyperlinks in Google Sheets

This guide explains how you can easily create and manage hyperlinks in Google Sheets. An entire cell in the sheet, or specific text inside the cell, can be linked to external web pages. A cell can also contain multiple hyperlinks.

If you type a web page address in a Google Sheet cell, it is automatically converted into a clickable hyperlink.

Text converted into hyperlink

You can add anchor text to plain hyperlinks for more accessible URLs. Hover your mouse over the hyperlink and click the Edit icon. Now add the anchor text in the Text input box and click the green Apply button.

Alternatively, you may use the built-in HYPERLINK function in Google Sheet to create web links with (optional) anchor text.

 =HYPERLINK("https://www.labnol.org", "Digital Inspiration")

Add anchor text to hyperlink

It is also possible to include multiple hyperlinks inside a single cell of the Google Sheet.

Just type any text, include URLs in plain text and when you move the cursor out of the cell, the URLs are converted into hyperlinks.

Bonus Tip: While a cell with multiple links is selected, press Alt+Enter and all the links with open at once in new tabs.

Multiple hyperlinks in Google Sheet Cell

You can use the previous technique to edit multiple hyperlinks contained in a single cell and add anchor text.

Hover your mouse over a link in the cell, click the edit icon and change the Anchor text. Repeat this for all other links in the same cell.

Format Muliple URLs

Also see Secret Google Drive URLs.

Here are some snippets that will help you manage your hyperlinks in Google Sheets using Google Script macros.

const createHyperLinkWithFormula = () => {
  const link = 'https://www.labnol.org';
  const text = 'Digital Inspiration';
  const value = `=HYPERLINK("${link}", "${text}")`;
  const sheet = SpreadsheetApp.getActiveSheet();
  const range = sheet.getRange('A1');
  range.setValue(value);
};
const createHyperLinkWithRichTextValue = () => {
  const link = 'https://www.labnol.org';
  const text = 'Digital Inspiration';
  const value = SpreadsheetApp.newRichTextValue()
    .setText(text)
    .setLinkUrl(link)
    .build();
  SpreadsheetApp.getActiveSheet().getRange('A1').setRichTextValue(value);
};
const createMultipleHyperLinks = () => {
  const value = SpreadsheetApp.newRichTextValue()
    .setText('Google acquired YouTube in 2006')
    .setLinkUrl(0, 6, 'https://www.google.com')
    .setLinkUrl(16, 23, 'https://www.youtube.com')
    .build();
  SpreadsheetApp.getActiveSheet().getRange('A1').setRichTextValue(value);
};
const extractLinkFromFormula = () => {
  const sheet = SpreadsheetApp.getActiveSheet();
  const range = sheet.getRange('A1');
  const formula = range.getFormula();
  const [, url, , text] =
    formula.match(/=HYPERLINK\("(.+?)"([;,]"(.+?)")?\)/) || [];
  Logger.log({ url, text: text || url });
};
const extractMultipleLinks = () => {
  const urls = SpreadsheetApp.getActiveSheet()
    .getRange('A1')
    .getRichTextValue()
    .getRuns()
    .map((run) => {
      return {
        url: run.getLinkUrl(),
        text: run.getText(),
      };
    })
    .filter(({ url }) => url);
  Logger.log(urls);
};

Let People Quickly Save your Events on their Calendars

You are organizing an online event - maybe a meeting on Zoom or a training session hosted on Google Meet - and you would like the attendees to add the event to their own calendars. Once added to their calendar, the event will act as an automatic reminder and attendees will get a notification when the conference is about to start.

There are two way to go about this:

  1. You can create a new meeting in your online calendar (Google, Outlook or any other calendar) and add the individual attendees as guests so the event automatically gets added to their calendar as well.

  2. You can include an “Add to Calendar” link or button in your email messages, forms and website pages. Anyone can click the link to quickly save your event on to their calendars - see live demo.

The Add to Calendar app can create links that will let people quickly save your events on to their own calendars. You can create links and event reminder buttons for Google Calendar, Outlook, Microsoft Office 365 and Yahoo! Calendar.

The app will also generate downloadable iCalendar .ics files.

Add to Calendar

To get started, add the event title and choose the default timezone of your event. Then use the built-in date and time picker to specify the event start date and end date. If the event spans the entire day, check the “All Day Event” option.

The event description field can have long text, hyperlinks and simple HTML tags for formatting. Next choose the calendar name to target and click the Generate button. The app generates plain links that you can paste in emails and HTML buttons (with inline CSS) for embedding in your web pages and email newsletters.

You can create “Add to Calendar” links on both the desktop and your mobile phone. People who click on these links can quickly save your event on their calendar, which will also remind them about your event automatically.

How to Create a Disposable Email Address with Gmail

A temporary email address is very useful when you don’t want to share your real email address with a website. There are a plethora of services - 10 Minute Email, Mailinator and MailDrop to name a few - that will mask your main email address behind a temporary alias and thus save your inbox from potential spam.

The only problem with using disposable email addresses is that it requires some work. You first need to generate a temporary address, paste it into the web form and then manually check the disposable inbox for any new email. And if you require another temporary address the next day, the whole exercise has to be repeated.

Disposable Email Addresses with Gmail

Here’s a new, simplified workflow that will let you use Gmail itself as a disposable email service provider.

You’ll have just one temporary email address to remember and every time your share that email on the Internet, you attach an expiry date. Any email messages sent to your disposable Gmail account after the expiry date are discarded automatically else they are forwarded to your main account.

Gmail Disposable Email

Let’s say your temporary email address is amit@gmail.com. A website form requires your email address so you can put amit+mmdd@gmail.com in the sign-up field where mmdd is the month and date till when that disposable email will stay valid.

For instance, if you specify the email address as amit+0623@gmail.com - that alias will be valid until June 23 and any emails sent to that alias after that date are ignored else they are forwarded to your main Gmail address. You can only specify the year in your temporary email amit+12312020@gmail.com in mmddyyyy format.

Make your own Temporary Email System with Gmail

Follow these steps to set up your own disposable email system in 2 minutes. Internally, it uses the Gmail plus trick and some Google Apps Script magic.

  1. Create a new Gmail address (link).

  2. While you are logged into your new Gmail account, click here to make a copy of the Google Script in your account.

  3. Inside the Google Script, go to line #13 and replace my email with the email address where you would like the temporary emails to be forwarded.

  4. Next, go to the Run menu, choose Run Function and select Initialize. Authorize the Google script and your disposable email system is up and running.

The script will check your Gmail inbox every five minutes and process messages based on the expiry date in the message To field. You just have to set it once and forget about it.

Your disposable address will last forever and yet it will protect your main inbox from spam. That’s it!

Under the Hood - How it works?

The Google Script is monitoring the temporary inbox using the Gmail API. If it discovers a new email that has an expiry date in the future, it simply forwards it to your main email account else it archives the message.

Here’s the source code:

/** Check if an email message should be forward from the
 * temporary inbox to the main Gmail inbox based on the
 * date in the TO field of the incoming message
 */
const isAllowed = (email = '') => {
  const [, mm, dd, yyyy] = email.match(/\+(\d{2})(\d{2})(\d{4})?@/) || [];
  if (mm) {
    const now = new Date();
    const date = new Date([yyyy || now.getFullYear(), mm, dd].join('/'));
    return date > now;
  }
  return false;
};

/**
 * Fetch the 10 most recent threads from Gmail inbox,
 * parse the To field of each message and either forward it
 * or archive the emssage
 */
const checkTemporaryInbox = () => {
  GmailApp.getInboxThreads(0, 10).forEach((thread) => {
    thread.getMessages().forEach((message) => {
      if (isAllowed(message.getTo())) {
        message.forward(RECIPIENT);
      }
    });
    thread.moveToArchive();
  });
};

How to Embed Google Slides Like a Pro!

It takes 2 easy steps to embed any Google Slides deck in your website. Open Google Slides, go to the File Menu and choose Publish to web. Your presentation becomes public and you are presented with an IFRAME HTML tag that you can copy-paste in any web page.

<iframe
  src="https://docs.google.com/presentation/d/e/xxxx/embed"
  frameborder="0"
  width="800"
  height="600"
></iframe>

Google Slides Embedded

Customize your Google Slide Embeds

The embedded Google Slides player can be easily customized by modifying the src attribute of the IFRAME tag.

Auto Start the Embedded Slideshow

Append start=true to the URL and the slideshow will auto-play as soon as someone opens your webpage. Or set start=false and the slideshow will only play when the visitor click the play icon in the slides player.

Change the duration of slides

With start set to true, you can add delayms=1000 to the URL to specify the time (in milliseconds) for which each slide should display before auto-advancing to the next one. For instance, start=true&delayms=6000, the slideshow will autoplay and the slides will auto-advance every 6 seconds (6000 ms).

Play the slideshow in Loop

Add restart=true to the slideshow URL and it will play in a loop, meaning it will auto-advance to the first slide after the last one.

Start from a Specific Slide

Your embedded Google Slides presentation will always start from the first slide in the deck. You can however customize the URL to start the slideshow from a specific slide by adding slide=id.p# to the URL, where # is the slide number.

For instance, if you wish to embed a slideshow with 8 seconds gap and starting from the 4th slide, your URL would be:

https://docs.google.com/presentation/d/e/xxxx/embed?start=true&delayms=8000&slide=id.p4

Remove the Google Branding and Player Control

The Google Slides player displays the controls and Google branding in the bottom bar. However, if you wish to play the slideshow in kiosk mode without any player controls or Google Branding, just adding rm=minimal to the IFRAME link (rm = Render Mode)

Make the Google Slides player Responsive

The embed code provided by Google Slides has a fixed height and width and will thus display at the same size on both desktops and mobile screens. You can however make the player responsive with a little bit of CSS as detailed below.

  1. Remove the height, width and other parameters from the IFRAME tag:
<iframe src="https://docs.google.com/presentation/d/e/xxxx/embed"></iframe>`
  1. Add this CSS to your HTML page. The padding-bottom is set to 56.25% for 16x9 ratio (9/16*100) so the height of the player would be 56.25% of the player’s width. Set the value to 75% for a 4:3 ratio.
<style>
  .responsive-google-slides {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Ratio */
    height: 0;
    overflow: hidden;
  }
  .responsive-google-slides iframe {
    border: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
  }
</style>
  1. Wrap the original IFRAME inside the responsive class and you are good to go. Here’s a live demo.
<div class="responsive-google-slides">
  <iframe src="https://docs.google.com/presentation/d/e/xxxx/embed"></iframe>
</div>

Also see: 🦋 Secret Google Docs URL Tricks