Skip to content

sungurkeremgezergun/google-shopping-feed-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Shopping Feed Analyzer

Validate and score your Google Shopping XML feeds against Merchant Center rules — instantly, in the browser.


Features

  • XML Feed Validation — Parses RSS 2.0 and Atom feed formats; identifies malformed or non-compliant XML.
  • Merchant Center Rules — Validates all required and optional fields against the official Google Merchant Center product data specification.
  • A–F Quality Scoring — Each feed receives a 0–100 score and a letter grade based on the ratio of valid to total products.
  • GTIN Checksum Verification — Validates the check digit for GTIN-8, GTIN-12, GTIN-13, and GTIN-14 product identifiers.
  • Per-Field Error Breakdown — Errors and warnings are grouped by field, with line numbers and current values for quick diagnosis.
  • Cross-Field Validation — Detects sale price higher than regular price, currency mismatches, and missing conditional fields.

Architecture

google-shopping-feed-analyzer/
├── server.js          # Express API server (port 3001)
├── rules.js           # Merchant Center validation rule definitions
├── client/            # React frontend (port 3000)
│   └── src/
│       ├── App.js
│       └── components/
│           ├── FileUpload.js
│           ├── AnalysisResults.js
│           ├── ScoreCard.js
│           ├── ErrorDetails.js
│           └── Header.js
└── docs/
    ├── samples/sample_feed.xml       # Synthetic 5-product feed for testing
    └── merchant-rules-reference.md  # Validation rules reference

The backend (Express on :3001) accepts XML file uploads, runs all validation rules server-side, and returns a structured JSON report. The frontend (React on :3000) provides the upload interface and renders the report.


Installation

Prerequisites: Node.js v14 or later, npm.

# Install backend dependencies
npm install

# Install frontend dependencies
npm run install-client

Running

# Start the backend API server (port 3001)
npm start

# In a separate terminal, start the React dev server (port 3000)
npm run client

Open http://localhost:3000 in your browser.

For production, build the React app first:

npm run build   # outputs to client/build/
npm start       # serves the built frontend + API on port 3001

Configuration

Environment Variable Default Description
CORS_ORIGIN http://localhost:3000 Allowed origin for CORS requests
MAX_UPLOAD_SIZE 52428800 (50 MB) Maximum accepted XML file size in bytes
PORT 3001 Port the Express server listens on

Set these in a .env file (not committed) or in your deployment environment.


API

POST /api/analyze

Analyzes an uploaded XML feed file.

Request: multipart/form-data with field xmlFile (.xml file, max 50 MB by default).

Response:

{
  "success": true,
  "summary": {
    "totalProducts": 100,
    "validProducts": 85,
    "invalidProducts": 15,
    "totalErrors": 23,
    "totalWarnings": 5,
    "score": 85,
    "scoreGrade": "B"
  },
  "errorsByField": [
    {
      "field": "gtin",
      "fieldName": "GTIN",
      "count": 3,
      "errors": [ ... ]
    }
  ],
  "allErrors": [ ... ],
  "warnings": [ ... ],
  "warningsByField": [ ... ]
}

Score grades: A (90–100), B (80–89), C (70–79), D (60–69), F (0–59).


Sample Feed

A synthetic 5-product feed is available at docs/samples/sample_feed.xml for testing. It covers common field combinations including sale prices, variants, preorder items, and additional images.


License

MIT License — Copyright 2026 sungurkeremgezergun. See LICENSE.

About

Google Shopping XML feed validator with Merchant Center rules compliance scoring (Node + React)

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors