Automate Competitor Analysis with n8n and AI

Stay ahead of the curve in your industry by effortlessly tracking your competitors’ publishing activity. This blog post details a powerful workflow you can build with n8n and the latest AI to automate competitor analysis, saving you valuable time and providing crucial insights. Want to explore how automation can streamline your business processes? Learn more about our AI automation solutions.

Competitor Analysis Workflow

What This Workflow Does

This automated workflow monitors your competitors’ content publishing schedules. It fetches their RSS feeds, normalizes the data, and stores it in a Google Sheet. Then, it uses AI to analyze the data and provide a concise summary, which is pushed to your Telegram channel. This allows SEO, content, and marketing teams to easily track competitor activity, and provides founders and PMs with a nightly snapshot of the competitive landscape.

Workflow Details

  • Schedule: Runs daily at 22:00 (Asia/Ho_Chi_Minh time – easily adjustable).
  • Fetch RSS: Uses an HTTP Request or RSS Read node to pull each competitor’s RSS feed URL.
  • Normalize & Limit: Parses the XML from the RSS feed into JSON, then limits the data to the most recent 5 posts per site.
  • Upsert to Google Sheets: Matches existing entries in your Google Sheet based on the link to avoid duplicates, and stores relevant fields like title, link, and excerpt.
  • Screenshot Dashboard: ApiFlash captures a screenshot of your Google Sheets dashboard.
  • Vision Analysis: Gemini 1.5-Flash analyzes the screenshot to extract key insights and create a textual summary.
  • Telegram Push: Posts the AI-generated summary (and optionally the screenshot) to your Telegram channel.

This workflow is a significant step towards leveraging the power of AI for competitive intelligence. For more comprehensive business support, consider exploring our managed WordPress admin support services.

Requirements

Before you begin, ensure you have the following:

  • n8n: A working instance of n8n, either cloud-hosted or self-hosted. Explore more n8n integrations and workflows on our blog.
  • Google Sheets OAuth2: Set up Google Sheets OAuth2 credentials for n8n.
  • Telegram Bot: Create a Telegram bot and obtain its API token.
  • ApiFlash: Have an ApiFlash account and obtain your access key.
  • Google Gemini: Access to the Google Gemini API.
  • A Google Sheet: A Google Sheet with columns like: `id/guid`, `site`, `link`, `title`, `excerpt`.

Setup and Configuration

  1. Import Workflow: Import the provided n8n workflow JSON into your n8n instance.
  2. Switch to RSS: Choose one of the following methods:
    Option A (Simple): Replace the HTTP Request nodes with RSS Read nodes, pasting your competitor’s RSS feed URLs into the input field.
    Option B (Keep HTTP): Keep the HTTP Request nodes, but set the Response type to XML and add a node to parse the XML.
  3. Mapping to Sheets: Point the first Mapping node to your Google Sheet by providing your document ID and sheet name. Ensure the matching condition is set correctly.
  4. ApiFlash: Add your ApiFlash access key to the ApiFlash node and specify the URL of your Google Sheet (including the correct GID).
  5. Gemini Vision: Use the `gemini-1.5-flash-latest` model in the Gemini Vision node and paste the provided prompt.
  6. Telegram: Enter your Telegram bot token and your Telegram chat ID in the Telegram node.
  7. Schedule: Confirm the schedule is set to run daily at 22:00 Asia/Ho_Chi_Minh (adjust time zone as needed).
  8. Test: Run the workflow once to verify that new rows are appended/updated in your Google Sheet, the dashboard renders correctly, and you receive the Telegram notification.

Extending to More Competitors

Easily add more competitors to your monitoring by:

  • Clone Nodes: Clone an HTTP/RSS node for each additional competitor.
  • Update URL: Update the `/feed/` URL in each cloned node to reflect the new competitor’s RSS feed.
  • No Other Changes: No other modifications to the workflow are required – the data will be normalized and upserted automatically.

Tips & Gotchas

  • WordPress RSS Data: WordPress RSS feeds typically include title, link, pubDate, guid, description, and other valuable information.
  • Dynamic Chart Source: Keep your Google Sheet chart source range dynamic (e.g., use open-ended ranges) to automatically include new data.
  • RSS Limits: If a site limits the number of items in its RSS feed, consider running multiple feeds (e.g., categorized feeds). Our WordPress expertise can help with managing complex feeds.

Interested in learning how AI can revolutionize your marketing efforts? Discover the possibilities with our AI services.

wp-admin
wp-admin