Back to Templates

Automate Email Tracking & Generate Pixel for Lead Nurturing with Google Sheet

Created by

Created by: Davide || n3witalia

Davide

Last update

Last update 13 hours ago

Share


This workflow automates the process of sending personalized lead-nurturing emails and tracking when each recipient opens the message through a custom tracking pixel. It integrates Google Sheets, Gmail, OpenAI, and webhooks to generate, deliver, and monitor engagement with your email sequence.

It sends personalized emails containing a unique, invisible tracking pixel and then monitors who opens the email by detecting when the pixel is loaded, logging the activity back to a Google Sheets CRM.


Key Features

1. Fully Automated Lead Nurturing

Once leads are added to the Google Sheet, the workflow handles everything:

  • Generating email content
  • Creating tracking pixels
  • Sending emails
  • Updating CRM fields

No manual actions required.

2. Real-Time Email Open Tracking

Thanks to the pixel + webhook integration:

  • You instantly know when a lead opens an email
  • Data is written back to the CRM automatically
  • No external email marketing platforms are needed

3. Infinite Scalability with Zero Extra Cost

You can send emails and track performance using:

  • n8n (self-hosted or cloud)
  • Gmail
  • Google Sheets
  • AI-generated content

This replicates features of expensive tools like HubSpot or Mailchimp—without their limits or pricing tiers.

4. Clean and Organized CRM Updates

The system keeps your CRM spreadsheet structured by automatically updating:

  • Send dates
  • Pixel IDs
  • Open status

This ensures you always have accurate, up-to-date engagement data.

5. Easy to Customize and Expand

You can easily add:

  • Multi-step email sequences
  • Click tracking
  • Lead scoring
  • Zapier/Make integrations
  • CRM synchronization

The workflow is modular, so each step can be modified or extended.


How it Works

  1. Load Lead Data from Google Sheets

    The workflow reads your CRM-like Google Sheet containing lead information (name, email, and status fields such as EMAIL 1 SEND, PIXEL EMAIL 1, etc.).

    This allows the system to fetch only the leads that haven’t received Email 1 yet.

  2. Generate a Unique Tracking Pixel

    For each lead, the workflow creates a unique identifier (“pixel ID”).
    This ID is later appended to a small invisible 1×1 image—your tracking pixel.

    Example pixel structure used in emails:

<img src width="1" height="1">

When the email client loads this image, n8n detects the open event via the webhook.

  1. Use AI to Generate a Personalized HTML Email

    An OpenAI node creates the email body in HTML, inserting the tracking pixel directly inside the content.
    This ensures the email is personalized, consistent, and automatically includes the tracking mechanism.

  2. Send the Email via Gmail

    The Gmail node sends the generated HTML email to the lead.

    After sending, the workflow updates the Google Sheet to log:

    • Email sent flag
    • Pixel ID generated
    • Sending date
  3. Detect Email Opens with Webhook + Pixel Image
    When the recipient opens the email, their client loads the hidden pixel.
    That triggers your webhook, which:

    • Extracts the pixel ID and email address from the query parameters
    • Matches it with the lead in Google Sheets
  4. Update CRM When Email Is Opened

    The workflow updates the CRM by marking OPEN EMAIL 1 as “yes” for the corresponding pixel ID.

    This transforms your sheet into a live tracking dashboard of lead engagement.


Set up Steps

To configure this workflow, follow these steps:

  1. Prepare the CRM:

    • Make a copy of the provided Google Sheet template.
    • In your copy, fill in the "DATE," "FIRST NAME," "LAST NAME," and "EMAIL" columns with your lead data.
  2. Configure the Workflow:

    • In the "Get CRM," "Update CRM," and "Update Open email 1" nodes, update the documentId field to point to your new Google Sheet copy.
    • In the "Generate Pixel" node, locate the webhook_url assignment. Replace the placeholder text https://YOUR_N8N_WEBHOOK_URL with the actual, production webhook URL generated by the "Webhook" node in your n8n environment. Important: After setting this, you must activate the workflow for the webhook to be live and able to receive requests.
  3. Configure Credentials:

    • Ensure the following credentials are correctly set up in your n8n instance:
      • Google Sheets OAuth2 API: For reading from and updating the CRM sheet.
      • Gmail OAuth2: For sending emails.
      • OpenAI API: For generating the email content.
  4. Test and Activate:

    • Execute the workflow once manually to send test emails. Check the Google Sheet to confirm that the "EMAIL 1 SEND," "PIXEL EMAIL 1," and "EMAIL 1 DATE" columns are populated.
    • Open one of the sent test emails to trigger the tracking pixel.
    • Verify in the Google Sheet that the corresponding lead's "OPEN EMAIL 1" field is updated to "yes."
    • Once testing is successful, activate the workflow.

Summary

This workflow provides a powerful, low-cost automation system that:

  • Sends personalized AI-generated emails
  • Tracks email opens via a unique pixel
  • Logs all actions into Google Sheets
  • Automatically updates lead engagement data

Need help customizing?

Contact me for consulting and support or add me on Linkedin.