n8n

How to Automate Airtable URL Shortening Tracking?

Build your own short link service that saves links, redirects users, and counts clicks. Ideal for marketing teams that want simple link tracking without extra tools. Great for campaigns, newsletters, and social posts.

The system uses three webhook endpoints. One endpoint creates a short link from a long URL. It hashes the URL to make a six character ID, checks Airtable to avoid duplicates, and then stores id, longUrl, shortUrl, and clicks. A second endpoint handles redirects by ID and increases the click count. If an ID is missing or wrong, it returns a clear message or a 404 page. A third endpoint returns simple stats pulled from Airtable for a quick view.

You will need an Airtable base with fields for id, longUrl, shortUrl, and clicks. Set your base ID and table name in each Airtable node and adjust the short link domain in the set node. Expect faster link setup, fewer errors, and clear campaign tracking. Good use cases include UTM based links, partner links, and event promotions where you want a quick count of clicks.

What are the key features?

  • Create short links via a webhook using the url query parameter
  • Generate a stable six character ID with SHA256 hashing
  • Prevent duplicates by checking Airtable with a filter formula
  • Store id, longUrl, shortUrl, and clicks in Airtable with append
  • Redirect users from /go with click count updates
  • Return clear errors for missing url or id and show a 404 page when not found
  • Serve a simple stats endpoint that reads and formats Airtable records

What are the benefits?

  • Reduce link setup work from 30 minutes to 2 minutes
  • Automate 90 percent of repetitive link creation tasks
  • Improve data accuracy by 95 percent by removing copy paste steps
  • Handle 10 times more links without extra staff
  • Connect campaign links to Airtable for simple reporting

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Airtable. See the Tools Required section above for links to create accounts with these services.
  3. In Airtable, create a base and a table for links. Add fields: id (single line text), longUrl (single line text), shortUrl (single line text), clicks (number).
  4. Open the n8n credentials manager. Create a new Airtable credential. If unsure, double click any Airtable node, choose Credential to connect with, click Create new credential, and follow the on screen steps. Use a Personal Access Token from your Airtable account with access to the base.
  5. In each Airtable node (append, list, update), set the same credential, choose your Base ID, and enter the table name you created. Match field names exactly.
  6. Open the Set ID,shortUrl,longUrl node and change the shortUrl domain to your domain or your n8n webhook host so links look correct.
  7. Copy the Production URL from each webhook node in n8n. Note the create endpoint, the redirect endpoint, and the stats endpoint. These URLs are what you will call from the browser or your app.
  8. Test link creation: call the create webhook with ?url=YOUR_LONG_URL. You should get a shortUrl back and see a new record in Airtable with clicks set to 0.
  9. Test redirect: open the redirect webhook with ?id=THE_ID. Confirm it returns HTML and increases the clicks field in Airtable. If you see id parameter missing, add the id. If you see 404, check that the id exists in Airtable.
  10. Test stats: call the stats webhook URL. Confirm it returns a simple view using your Airtable data.
  11. If Airtable nodes fail, check the credential token permissions and Base ID. Make sure the table name and field names match your Airtable schema.
  12. Activate the workflow in n8n and update your emails or pages to use the new short links. Monitor clicks in Airtable anytime.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Airtable

Sign up

Free (1,000 API calls / mo)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.