Save Settings

Authorization
string
required
siteId
string
required
ga4TrackingId
string
G-XXXXXXXXXX 形式
seoTitle
string
seoDescription
string
seoKeywords
string
カンマ区切り
ogImage
string
画像URL
curl -X POST https://app.hirameki-web.com/api/save-analytics-settings \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "siteId":"2f9e07d7-bf4a-4df8-9d7a-xxxx",
    "ga4TrackingId":"G-1234567890",
    "seoTitle":"カフェサイト",
    "seoDescription":"温かみのあるカフェ",
    "ogImage":"https://cdn.example.com/og.png"
  }'

Load Settings

curl https://app.hirameki-web.com/api/get-analytics-settings/2f9e07d7-bf4a-4df8-9d7a-xxxx \
  -H "Authorization: Bearer {token}"
{
  "success": true,
  "settings": {
    "ga4TrackingId": "G-1234567890",
    "seoTitle": "カフェサイト",
    "seoDescription": "温かみのあるカフェ",
    "seoKeywords": "coffee, cafe, tokyo",
    "ogImage": "https://cdn.example.com/og.png"
  }
}

Get Site Analytics

GET /api/get-site-analytics/:siteId?days=7 レスポンスには期間内のPV・訪問者・リファラーなどの集計が含まれます。大量アクセス時は days を短くして負荷を抑えてください。
.sitemeta.json に保存されるため、GitやS3にエクスポートしておくと他ツールとも同期しやすくなります。