Skip to content

sanjayy-22/sheet-tracker-n8n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sheet-tracker-n8n

i created a n8n agent to track click count of urls

πŸŽ₯ YouTube URL QR & Click Tracking Workflows

This project contains two connected n8n workflows for automating the generation of redirect URLs + QR codes for YouTube videos, and for tracking QR scans and click counts in Google Sheets.

  • urlcreator workflow β†’ Reads YouTube links from a Google Sheet, normalizes them, and generates redirect URLs & QR codes.
  • finalcloud workflow β†’ Handles incoming QR scans via a webhook, redirects to the correct YouTube video, and logs click count & metadata (IP, user-agent, timestamp) back to Google Sheets.

πŸ“‘ Table of Contents


πŸ“Œ Introduction

These workflows enable you to:

  • Automate YouTube link cleanup & normalization (handling youtu.be, shorts, watch?v=, and playlists).
  • Generate redirect URLs that funnel clicks through a tracking webhook.
  • Create QR codes for each video link.
  • Track clicks, user agent, IP, timestamp, and total scan counts in Google Sheets.

Perfect for campaigns, classrooms, or organizations where you need to distribute scannable video links while collecting analytics.


⚑ Workflows

1. URL Creator (urlcreator)

  • Trigger: Manual Trigger
  • Steps:
    1. Read All Videos β†’ Fetch rows from Google Sheets (Videos!A1:H999).
    2. Generate URLs β†’
      • Normalize YouTube URLs.
      • Generate redirect URL pointing to the webhook.
      • Generate a QR code using api.qrserver.com.
    3. Update Videos Sheet β†’ Write Redirect URL and QR Code URL back to Google Sheets.

βœ… Skips headers & empty rows.
βœ… Handles multiple YouTube URL formats.


2. QR Scan & Tracking (finalcloud)

  • Trigger: Webhook (/track-scan).
  • Steps:
    1. Process Click Data β†’ Extract id, target, user-agent, IP.
    2. Redirect to YouTube β†’ Sends user to the final YouTube link.
    3. Log to Google Sheets β†’ Append click event details.
    4. Get Existing Row β†’ Find the video by ID.
    5. Increment Count β†’ Increase Click Count for that video.
    6. Update Click Count β†’ Save back into the sheet.

βœ… Stores timestamp, date, time, user agent, and IP.
βœ… Increments click count on each scan.


πŸ›  Installation

  1. Install n8n.
  2. Import both JSON workflows into n8n:
    • urlcreator_final.json
    • finalcloud_final.json
  3. Set up Google Sheets credentials in n8n.
  4. Configure your Google Sheet with the correct structure (see below).
  5. Deploy the workflows (ensure finalcloud webhook is active).

πŸš€ Usage

  1. Populate Google Sheets with video IDs & YouTube URLs.
  2. Run urlcreator workflow β†’ Fills sheet with redirect & QR code links.
  3. Share the QR codes publicly.
  4. When users scan, finalcloud workflow:
    • Redirects them to the YouTube video.
    • Logs the scan details.
    • Increments the click counter.

πŸ“œ License

This project is open source under the MIT License.

About

i created a n8n agent to track click count of urls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors