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:
- Go to PrimeLink → Settings → Integrations
- Find the Google Drive section
- Enter your Google Drive API Key
- Save settings
Method 2: OAuth (Browse)
For browsing files, you need OAuth credentials:
- Go to PrimeLink → Settings → Integrations
- Find the Google Drive section
- Enter Client ID and Client Secret
- Authorize PrimeLink to access your Google Drive
- Save settings
Setting Up Google Drive API
For API Key (Fetch Method):
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google Drive API
- Go to Credentials → Create Credentials → API Key
- Copy the API key
- Paste it into PrimeLink Settings → Integrations → Google Drive
For OAuth (Browse Method):
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google Drive API
- Enable Google Picker API
- Configure OAuth Consent Screen
- Add scope:
https://www.googleapis.com/auth/drive.readonly - Create OAuth 2.0 Client ID credentials
- Add authorized redirect URI
- Copy Client ID and Client Secret
- Paste into PrimeLink Settings → Integrations → Google Drive
- Authorize PrimeLink in the settings
How to Import from Google Drive
Step 1: Select Google Drive Option
In Step 2 of the import wizard:
- Find the Upload From Google Drive option
- Click to select it
- The Google Drive panel will appear
Step 2: Specify File
You can specify the file in two ways:
Method 1: Fetch (API Key)
- Enter the file ID or share link in the input field
- File must be public (shared with "Anyone with the link")
- Click Fetch to download the file
Method 2: Browse (OAuth)
- Click the Browse button
- Google Picker will open
- Select your Google account if prompted
- Navigate to your file in Google Drive
- Select the file you want to import
- The file will be automatically fetched
Search Files
If search is available:
- Use the search input field
- Type file name or keywords
- Search results will appear
- Select the file from results
Step 3: Continue Import
Once the file is fetched:
- The file will be parsed automatically
- Columns/fields will be detected
- A preview of the data will be shown
- 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=sharinghttps://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
Import files from Dropbox
Learn More →Import files from OneDrive
Learn More →Map your imported data to WooCommerce fields
Learn More →