1stContact.ai

1stContact.AI CRMWeb Design

Building a Configurable Mega Menu

Building a Configurable Mega Menu

Google Sheets API Key Setup Guide

πŸ”‘ Google Sheets API Key Setup Guide

Follow these steps to get your API key for the mega menu system

1Go to Google Cloud Console

Navigate to the Google Cloud Console and sign in with your Google account:

πŸ“ https://console.cloud.google.com/

2Create or Select a Project

Option A: Create New Project

  • Click the project dropdown at the top
  • Click "New Project"
  • Enter project name: "1stContact Menu System"
  • Click "Create"

Option B: Use Existing Project

  • Select your existing project from the dropdown
πŸ’‘ Tip: If this is your first time, create a new project to keep things organized.
3Enable Google Sheets API

In your project dashboard:

  • Click on "APIs & Services" in the left sidebar
  • Click "Enable APIs and Services" (blue button at top)
  • Search for "Google Sheets API"
  • Click on "Google Sheets API" from results
  • Click the blue "Enable" button
Screenshot: API Library with Google Sheets API enabled
4Create API Key

Now create your API key:

  • Go to "APIs & Services" β†’ "Credentials"
  • Click "+ Create Credentials" at the top
  • Select "API Key" from the dropdown
  • Your API key will be generated and displayed
API Key created: AIzaSyC4Q2Rf9lhY8sF7XpWq3bN6mK8J4vZ2A1B
βœ… Success! Copy this API key immediately - you'll need it for your website code.
5Restrict Your API Key (Security)

For security, restrict your API key:

  • Click the pencil icon next to your new API key
  • Under "API restrictions":
    • Select "Restrict key"
    • Check "Google Sheets API"
    • Uncheck all others
  • Under "Website restrictions" (optional):
    • Select "HTTP referrers"
    • Add your domain: *.1stcontact.ai/*
  • Click "Save"
⚠️ Important: API restrictions may take up to 5 minutes to take effect.
6Find Your Google Sheet ID

Open your Google Sheet and look at the URL:

https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit↑ This is your Sheet ID ↑

Copy the long string between /d/ and /edit

Sheet ID Example: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
7Make Your Sheet Public

Your sheet needs to be publicly viewable:

  • In your Google Sheet, click "Share" (top right)
  • Click "Change to anyone with the link"
  • Set permission to "Viewer"
  • Click "Done"
⚠️ Privacy Note: This makes your sheet readable by anyone with the link, but they cannot edit it.
8Update Your Website Code

Replace these values in your JavaScript code:

const SHEET_CONFIG = {// Replace with your actual valuesSHEET_ID: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms',API_KEY: 'AIzaSyC4Q2Rf9lhY8sF7XpWq3bN6mK8J4vZ2A1B',RANGES: {'Products': 'Products!A2:F100','Solutions': 'Solutions!A2:F100','Resources': 'Resources!A2:F100','Features': 'Features!A2:F100','Company': 'Company!A2:F100'}};
9Test Your Setup

To verify everything works:

  • Open your browser's Developer Tools (F12)
  • Go to the Console tab
  • Refresh your webpage
  • Look for success messages like "Navigation system initialized successfully"
βœ… Success! Your mega menus are now powered by Google Sheets!
πŸ” Troubleshooting: If you see errors, check that:
  • Your API key is correct
  • Your Sheet ID is correct
  • Your sheet is publicly viewable
  • API restrictions have taken effect (wait 5 minutes)

πŸŽ‰ Congratulations!

You've successfully set up Google Sheets API for your 1stContact.ai mega menus!

Now you can update your navigation menus by simply editing your Google Sheet.

πŸ“š Quick Reference:

Google Cloud Console: console.cloud.google.com

API Key Location: APIs & Services β†’ Credentials

Sheet ID Location: In your Google Sheet URL between /d/ and /edit

Sheet Structure: Card Title | Card Subtitle | Card Icon | Link Text | Link URL | Link Icon

" data-margin-top="0" data-margin-bottom="0" placeholdertext="Custom HTML/CSS/JAVASCRIPT" style="">
Custom HTML/CSS/JAVASCRIPT
See the AI CRM this article comes from.

1stContact.ai answers calls and texts 24/7, books appointments, and keeps every lead in one pipeline. $197/mo, unlimited users and contacts.

View plans

Read this article on the site Β· All articles