How to Build a Google Ads to Mixpanel Integration Using Google Sheets & Apps Script (Timezone-Safe)

A step-by-step guide to automating your Google Ads data pipeline without expensive third-party tools

Introduction

In today’s data-driven marketing landscape, having your Google Ads performance data flowing seamlessly into analytics platforms like Mixpanel isn’t just nice to have—it’s essential for making informed campaign decisions. Yet most marketing teams find themselves stuck between expensive third-party connectors that cost hundreds per month, or time-consuming manual exports that are prone to human error.

What if you could build a robust, automated data pipeline using tools you already have? This comprehensive guide walks you through creating a Google Ads to Mixpanel integration using Google Sheets and Apps Script—completely free and fully customizable. By the end of this blog post, you’ll have a system that automatically pulls your campaign data and formats it perfectly for Mixpanel, saving hours of manual work while ensuring data accuracy across global campaigns.

Prerequisites

Before diving into the implementation, make sure you have:

  • Google Ads API access with an active developer token
  • Google Ads account with campaign data to export
  • Mixpanel account for receiving the imported data
  • Google Workspace account (for Google Sheets and Apps Script)
  • Basic understanding of APIs and data formats (helpful but not required)

Don’t have Google Ads API access yet? You’ll need to apply through the Google Ads Developer Center and get approved for API access before proceeding.

The Problem Every Marketing Data Analyst Faces

If you’re reading this, chances are you’ve experienced the frustration firsthand: another morning spent manually downloading Google Ads data and reformatting spreadsheets. Meanwhile, your team is asking for real-time insights in Mixpanel, and you’re stuck playing the role of human data pipeline.

You know your campaigns are generating valuable data, but getting that information into your analytics platform feels like an uphill battle against file formats and the ever-present risk of human error.

As a Marketing Data Analyst at a digital agency, I’ve seen this pain point repeatedly. Clients need their Google Ads data in Mixpanel for advanced analytics, but the existing solutions either:

  • Cost hundreds of dollars per month for simple data transfers
  • Break when dealing with different timezones
  • Require complex ETL tools that are overkill for most agencies
  • Don’t provide the flexibility to customize data formats

After struggling with timezone inconsistencies and unreliable third-party connectors, I decided to build a custom solution using Google Apps Script. Here’s how you can do the same.

Why This Integration Matters

For Marketing Agencies:

  • Provide clients with campaign data in their preferred analytics tool
  • Reduce manual reporting time by 80%+
  • Offer premium data services without expensive middleware

For In-House Teams:

  • Combine Google Ads data with other marketing touchpoints in Mixpanel
  • Build custom attribution models with clean, timestamped data
  • Automate daily/weekly reporting workflows
  • Ensure data accuracy across different timezones

The Solution: Google Apps Script + Smart Date Handling

Here’s the architecture I built:

1. Google Sheets as the Control Center

  • Setup Sheet: Users input date ranges without touching code
  • Google Ads Data Sheet: Raw campaign metrics with calculated KPIs
  • Mixpanel Sheet: Transformed data ready for import

2. Google Ads API Integration

Using the latest Google Ads API v19 with the searchStream method for reliable data retrieval:

3. Timezone-Safe Data Transformation

The breakthrough was using UTC ISO strings instead of JavaScript Date objects:

This ensures that June 19th data appears as June 19th in Mixpanel, regardless of where the script runs.

Step-by-Step Implementation

Phase 1: Google Ads API Setup

  1. Get API credentials from Google Ads Developer Center
  2. Configure OAuth 2.0 with refresh token for automated access
  3. Test connectivity with a simple campaign query

Phase 2: Apps Script Development

  1. Create the Google Sheet with three tabs (Setup, Google Ads Data, Mixpanel)
  2. Build the API integration with proper error handling
  3. Implement data transformation with timezone-safe date handling
  4. Add user-friendly menu for non-technical team members

Phase 3: Data Validation & Testing

  1. Cross-check metrics between Google Ads UI and your output
  2. Test timezone consistency with team members in different locations
  3. Validate Mixpanel import format and data accuracy

Phase 4: Mixpanel Implementation

  1. Install the Google Sheets Add-On in your Mixpanel project
  2. Configure the data source by connecting your Google Sheet
  3. Map your data fields to ensure proper event structure
  4. Set up automated sync for daily or real-time data updates

For the full appscript code, please copy the content of this file to your code.gs section of your appscript application.

Mixpanel Implementation

Once your Google Sheets automation is running smoothly, getting the data into Mixpanel is straightforward thanks to Mixpanel’s native Google Sheets integration.

Setting Up the Mixpanel Google Sheets Add-On

Mixpanel offers a dedicated Google Sheets Add-On that eliminates the need for complex API calls or manual data imports. Before you begin, ensure you have your Mixpanel service account credentials and Mixpanel Project ID ready, as these will be required during the setup process.

Step 1: Install the Add-On Navigate to your Mixpanel project settings and locate the “Import Data” section. Select “Google Sheets” as your data source and follow the authentication prompts to connect your Google account. You’ll need to provide your Mixpanel service account credentials and Project ID to establish the secure connection.

Step 2: Configure Your Data Source Point the add-on to your spreadsheet containing the transformed Google Ads data. The add-on will automatically detect your “Mixpanel” sheet and recognize the event structure you’ve created.

Step 3: Field Mapping Map your Google Sheets columns to Mixpanel event properties:

  • Time column → Event timestamp
  • Event column → Event name
  • Campaign data → Event properties
  • Custom metrics → Additional properties

Step 4: Authentication & Project Setup During the initial configuration, you’ll authenticate using:

  • Service Account Credentials – For secure, automated data access
  • Project ID – To ensure data flows to the correct Mixpanel project
  • Permissions validation – Confirming the service account has import rights

Step 5: Automation Settings Configure the sync frequency based on your reporting needs:

  • Real-time sync for immediate data availability
  • Daily sync for regular reporting cycles
  • Manual sync for testing and validation

Benefits of the Native Integration

Using Mixpanel’s Google Sheets Add-On provides several advantages:

  • No additional coding required – The integration handles API calls automatically
  • Real-time data sync – Updates appear in Mixpanel within minutes
  • Error handling – Built-in validation prevents malformed data imports
  • Scalability – Handles growing data volumes without performance issues
  • Audit trail – Complete visibility into data import status and history

This approach creates a seamless pipeline from Google Ads → Google Sheets → Mixpanel, with each component handling its specialized function while maintaining data integrity throughout the process.

Key Metrics We Track

The integration pulls essential campaign metrics and calculates additional KPIs:

  Google Ads Metrics:

  • Impressions, Clicks, Cost, Conversions
  • Campaign ID and Name
  • Date segmentation

  Calculated KPIs:

  • CPC (Cost Per Click)
  • CPM (Cost Per Mille)
  • CTR (Click-Through Rate)
  • CVR (Conversion Rate)

  Mixpanel-Ready Format:

  • Event-based structure with proper timestamps
  • Consistent insert IDs for deduplication
  • Custom properties for advanced segmentation

Real-World Results

After implementing this solution for our agency:

  • Reduction in manual data entry time
  • 100% timezone consistency across global campaigns
  • Daily automated updates instead of weekly manual reports
  • Cost efficient solution compared to third-party connectors
  • Zero data discrepancies between Google Ads and Mixpanel

Lessons Learned

What Worked Well:

  • Google Apps Script is surprisingly powerful for marketing automation
  • Refresh tokens provide reliable, long-term API access
  • UTC ISO strings solve most timezone headaches
  • User-friendly interfaces increase adoption among non-technical teammates

Common Pitfalls to Avoid:

  • Don’t use JavaScript Date objects for timezone-sensitive data
  • Always validate API responses before processing
  • Include proper error handling for expired tokens
  • Test with different user timezones before going live

Pro Tips:

  • Use searchStream instead of search for better performance
  • Set times to noon UTC to avoid timezone edge cases
  • Include insert IDs to prevent duplicate events in Mixpanel
  • Add console logging for easier debugging

Scaling Considerations

This solution easily scales for most agency needs:

  • Multiple clients: Duplicate the sheet template
  • Additional data sources: Extend the script for Facebook Ads, LinkedIn, etc.
  • Advanced transformations: Add custom calculated fields
  • Scheduling: Use Apps Script triggers for automatic daily runs

For enterprise needs (100+ accounts), consider migrating to Google Cloud Functions with Cloud Scheduler.

Conclusion

Building a custom Google Ads to Mixpanel integration using Google Sheets and Apps Script proves that marketing teams don’t need expensive enterprise tools to achieve enterprise-level data automation. With just a few hours of setup time, you can create a robust, timezone-safe pipeline that delivers clean, actionable data to your analytics platform every day.

The key takeaways from this implementation:

  • Cost-effective solutions deliver enterprise value – Google Apps Script provides enterprise-grade automation capabilities
  • Timezone handling is critical – Use UTC ISO strings to ensure data consistency across global teams
  • User-friendly interfaces matter – A simple setup sheet makes the tool accessible to non-technical team members
  • Custom solutions offer flexibility – You control the data format, timing, and transformations

This integration has transformed how our agency delivers data insights to clients, eliminating manual reporting bottlenecks while ensuring 100% data accuracy. The principles and techniques covered here can be applied to virtually any marketing data pipeline challenge you face.

Whether you’re managing campaigns for multiple clients or optimizing performance for your own organization, having reliable, automated data flows is no longer optional—it’s the foundation of competitive marketing performance.

Ready to Take Your Marketing Analytics to the Next Level?

Transform your marketing performance with advanced analytics and proven methodologies. The Hive Digital Team specializes in implementing attribution models, marketing mix analysis, and growth optimization systems that maximize your marketing effectiveness. 

 Contact the Hive Digital Team today to build a data-driven marketing strategy that outperforms the competition.