Google Drive

Import files directly from your Google Drive account

Overview

PrimeLink can import files directly from your Google Drive account. This integration supports two methods: using an API Key for public files, or OAuth authentication with Google Picker for browsing and selecting files.

The Fetch method works with API Key and public files, while Browse uses Google Picker API for direct file selection.

Prerequisites

Method 1: API Key (Fetch)

For fetching public files, you need a Google Drive API Key:

  1. Go to PrimeLink → Settings → Integrations
  2. Find the Google Drive section
  3. Enter your Google Drive API Key
  4. Save settings

Method 2: OAuth (Browse)

For browsing files, you need OAuth credentials:

  1. Go to PrimeLink → Settings → Integrations
  2. Find the Google Drive section
  3. Enter Client ID and Client Secret
  4. Authorize PrimeLink to access your Google Drive
  5. Save settings

Setting Up Google Drive API

For API Key (Fetch Method):

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google Drive API
  4. Go to CredentialsCreate CredentialsAPI Key
  5. Copy the API key
  6. Paste it into PrimeLink Settings → Integrations → Google Drive

For OAuth (Browse Method):

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google Drive API
  4. Enable Google Picker API
  5. Configure OAuth Consent Screen
  6. Add scope: https://www.googleapis.com/auth/drive.readonly
  7. Create OAuth 2.0 Client ID credentials
  8. Add authorized redirect URI
  9. Copy Client ID and Client Secret
  10. Paste into PrimeLink Settings → Integrations → Google Drive
  11. Authorize PrimeLink in the settings

How to Import from Google Drive

Step 1: Select Google Drive Option

In Step 2 of the import wizard:

  1. Find the Upload From Google Drive option
  2. Click to select it
  3. The Google Drive panel will appear

Step 2: Specify File

You can specify the file in two ways:

Method 1: Fetch (API Key)

  1. Enter the file ID or share link in the input field
  2. File must be public (shared with "Anyone with the link")
  3. Click Fetch to download the file

Method 2: Browse (OAuth)

  1. Click the Browse button
  2. Google Picker will open
  3. Select your Google account if prompted
  4. Navigate to your file in Google Drive
  5. Select the file you want to import
  6. The file will be automatically fetched

Search Files

If search is available:

  1. Use the search input field
  2. Type file name or keywords
  3. Search results will appear
  4. Select the file from results

Step 3: Continue Import

Once the file is fetched:

  1. The file will be parsed automatically
  2. Columns/fields will be detected
  3. A preview of the data will be shown
  4. Click Next to proceed to Step 3

File ID and Share Links

File ID Format

Google Drive file IDs are long alphanumeric strings:

  • Example: 1a2b3c4d5e6f7g8h9i0j
  • Found in the file's share link
  • Extract from: https://drive.google.com/file/d/FILE_ID/view

Share Link Format

You can use full Google Drive share links:

  • https://drive.google.com/file/d/FILE_ID/view?usp=sharing
  • https://drive.google.com/open?id=FILE_ID
  • File must be shared with "Anyone with the link" for API Key method

Best Practices

  • Use OAuth for Browse: OAuth method is more convenient for browsing
  • Share files properly: For API Key method, ensure files are public
  • Organize files: Keep import files in dedicated Google Drive folders
  • Use consistent naming: Name files clearly for easy identification
  • Test credentials: Verify API Key or OAuth works before setting up imports
  • Monitor file updates: Ensure files in Google Drive are current
  • Secure credentials: Keep API keys and OAuth credentials secure

Troubleshooting

API Key Invalid

  • Verify API key is correct in Settings → Integrations
  • Check Google Drive API is enabled in Google Cloud Console
  • Ensure API key has proper restrictions (if configured)
  • Regenerate API key if needed

OAuth Authorization Fails

  • Verify Client ID and Client Secret are correct
  • Check OAuth Consent Screen is configured
  • Ensure redirect URI is correct
  • Verify Google Picker API is enabled
  • Check required scopes are added

File Not Found

  • Verify file ID or share link is correct
  • Check file exists in your Google Drive
  • For API Key method, ensure file is public
  • Use Browse to locate file if OAuth is configured

Fetch Fails

  • Check internet connection
  • Verify Google Drive API is accessible
  • For API Key method, ensure file is shared publicly
  • Check file size isn't too large
  • Review error messages for details

Next Steps

☁️ Dropbox

Import files from Dropbox

Learn More →
☁️ OneDrive

Import files from OneDrive

Learn More →
🗺️ Field Mapping

Map your imported data to WooCommerce fields

Learn More →