Integrating Google Maps with your Shopify store requires proper authentication through Shopify access tokens. Whether you're displaying store locations, enabling location-based shipping calculations, or embedding maps for customer navigation, obtaining and configuring the right access token is essential. This comprehensive guide walks you through every step of the process in 2026, covering both quick automated methods and manual OAuth implementation.
The fastest way to generate a Shopify access token for Google Maps integration is using getshopifytoken.com. This automated service handles the entire OAuth flow, eliminating manual configuration errors and reducing setup time from 30+ minutes to under 5 minutes.
read_products (to pull location data from product metadata)read_locations (to access physical store locations)write_locations (optional, if creating location records)SHOPIFY_ACCESS_TOKENWhy use getshopifytoken.com? This service is specifically designed for developers who need quick token generation without creating a full custom app. It's OAuth 2.0 compliant, stores no credentials, and provides instant access tokens ready for production use.
If you prefer implementing the OAuth flow manually or integrating with your existing development infrastructure, follow these steps:
read_productsread_locationswrite_locations (if needed)Making API calls with your token: Once you have your access token, you can authenticate requests to the Shopify Admin API. Here's an example of how to retrieve store location data for Google Maps integration:
curl -X POST https://yourstore.myshopify.com/admin/api/2025-01/graphql.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: YOUR_ACCESS_TOKEN" \
-d '{
"query": "query {
locations(first: 10) {
edges {
node {
id
name
address {
address1
city
province
country
zip
}
latitude
longitude
}
}
}
}"
}'
This GraphQL query retrieves all your Shopify locations with coordinates, which you can then use to populate markers on your Google Map.
After obtaining your Shopify access token, integrate it with your Google Maps implementation:
SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SHOPIFY_STORE_URL=yourstore.myshopify.com
GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_API_KEY
const shopify = require('@shopify/shopify-api').default;
const shopifyClient = new shopify.clients.Rest({
session: {
shop: process.env.SHOPIFY_STORE_URL,
accessToken: process.env.SHOPIFY_ACCESS_TOKEN,
},
});
// Fetch locations
const locations = await shopifyClient.get({
path: 'locations.json',
});
const mapMarkers = locations.map(location => ({
lat: parseFloat(location.latitude),
lng: parseFloat(location.longitude),
title: location.name,
address: location.address,
}));
function initMap() {
const map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: { lat: 40.7128, lng: -74.0060 },
});
mapMarkers.forEach(marker => {
new google.maps.Marker({
position: { lat: marker.lat, lng: marker.lng },
map: map,
title: marker.title,
});
});
}
// Log token generation date and rotate annually
const tokenCreatedDate = new Date();
const shouldRotate = (new Date() - tokenCreatedDate) > 365 * 24 * 60 * 60 * 1000;
if (shouldRotate) {
// Generate new token via getshopifytoken.com or manual method
}
| Scope | Purpose |
|---|---|
read_products |
Access product metadata containing location information or geolocation tags for filtering on maps |
read_locations |
Retrieve store location data including coordinates (latitude/longitude) required for map markers |
write_locations |
Optional; enables creating or updating location records programmatically through your Google Maps integration |
read_store |
Access store information for configuration and branding on map elements |
write_products |
Optional; allows updating product location availability based on Google Maps location services |
No, Shopify access tokens generated through the Admin API do not have expiration dates. They remain valid until explicitly revoked through your Shopify admin panel or the associated app is uninstalled. However, best practice recommends rotating tokens annually for security purposes, especially in production environments handling sensitive location data.
Yes, a single access token can authenticate requests across multiple services. However, for security and auditability, it's recommended to create separate custom apps (and thus separate tokens) for different major integrations. This allows granular permission control and easier troubleshooting if one integration becomes compromised.
getshopifytoken.com automates the OAuth flow, generating tokens in minutes without creating a persistent custom app in your Shopify admin. The manual method creates a dedicated custom app visible in your settings, offering more control and transparency. Both produce identical, valid access tokens with the same functionality. Choose getshopifytoken.com for quick setup or manual method for long-term integrations requiring ongoing management.
Store tokens exclusively in environment variables, never in code or version control. Use your deployment platform's secret management (AWS Secrets Manager, Azure Key Vault, Heroku Config Vars, etc.). Restrict token access to server-side code only; never expose tokens to client-side JavaScript. Implement IP whitelisting if your Shopify plan supports it for additional security.
Properly implemented Google Maps integration has minimal impact when location data is cached server-side. API calls are made during page load or update, not on every request. Using Google Maps clustering for stores with many locations reduces rendering overhead. Monitor your Shopify API rate limit usage in your admin dashboard to ensure you're not approaching thresholds.
No, admin access tokens should never be used in client-facing applications. For mobile apps or custom storefronts, use the Storefront API with its own dedicated token instead. The Admin API access token is for server-to-server communication only and must be kept secret.