A production-ready Google Apps Script web app for managing Shopee affiliate products in Google Sheets.
Code.gs Web entry point and public server API
Utils.gs Configuration, validation, normalization and statistics
Database.gs Cached/locked spreadsheet data access and CSV import
Index.html Application shell
Sidebar.html Navigation
Dashboard.html Dashboard cards and chart containers
Product.html Products, categories, favorites and settings views
Import.html CSV upload, preview, progress and report view
Style.html Responsive light/dark premium dashboard styling
Script.html Vanilla JavaScript application logic
appsscript.json Apps Script V8 manifest
-
Create a Google Spreadsheet.
-
Create a sheet named
Products(the app will also create it automatically). -
Row 1 uses these columns:
ID | Product Name | Category | Store | Price | Sales | Commission | Affiliate Link | Extra Commission Link | Status | Created At | Favorite | Image URL
The first eleven columns match the requested schema. Favorite and Image URL are appended to persist favorites and optional product images.
- Open the spreadsheet and choose Extensions → Apps Script, or create a standalone Apps Script project.
- Add every
.gsand.htmlfile from this folder. In Apps Script, pasteappsscript.jsonthrough Project Settings → Show appsscript.json manifest file. - For a spreadsheet-bound project, no property is needed. For a standalone project, open Project Settings → Script Properties and add
SPREADSHEET_IDwith the ID from the spreadsheet URL. - Run
ensureDatabase_once from the editor and approve the requested spreadsheet permissions. This step is optional because the first web request also initializes the sheet. - Select Deploy → New deployment → Web app.
- Set Execute as to yourself and choose the desired access level. For a personal tool, restricting access to your Google account or Workspace domain is recommended.
- Deploy, authorize, and open the generated web-app URL.
When code changes, use Deploy → Manage deployments → Edit → New version.
Product Name is required. Supported headers are:
Product Name,Category,Store,Price,Sales,Commission,Affiliate Link,Extra Commission Link,Status,Created At,Image URLDuplicates are detected using the case-insensitive combination of product name, store, and affiliate link. Imports are limited to 5,000 rows per request.
Shopee Indonesia bulk-link exports are supported directly. The importer automatically detects semicolon delimiters and maps Nama Produk, Nama Toko, Harga, Penjualan, Komisi hingga, Link Produk, and Link Komisi Ekstra. Local values such as 90,6RB, 10RB+, 10,50%, and Rp9.064 are converted automatically.
- Prices are stored as numeric IDR values; commissions are numeric percentages.
- Reads are cached for five minutes and every mutation clears the cache.
- Writes use
LockServiceand batch ranges to prevent concurrent corruption and minimize spreadsheet calls. - For stronger access control, deploy only to your account/domain. UI escaping and server validation do not replace deployment-level authentication.
- Add scheduled Shopee product metadata and image synchronization through an authorized API.
- Add historical commission/sales snapshots for time-series charts.
- Add export, undo/archive, audit history, and automatic backups.
- Add server-side pagination when the catalog grows beyond several thousand products.
- Add configurable CSV column mapping for exports from different marketplaces.