---
name: cta_platform_config.aiconfig
description: CTA 按钮的多平台适配配置 - 支持 Facebook、Google、TikTok、Unity Ads 等平台的 CTA SDK 差异化接入
triggers: CTA,call to action,下载按钮,install button,平台适配,platform,facebook,google,tiktok,unity ads
---

# cta_platform_config.aiconfig

CTA（Call-to-Action）按钮的多平台适配配置。不同广告平台对 CTA 的实现方式有显著差异：

| 平台 | SDK | 调用方式 |
|------|-----|---------|
| Facebook | `FbPlayableAd` | `FbPlayableAd.onCTAClick()` |
| Google | `ExitApi` | `ExitApi.exit()` |
| TikTok | `window.playableSDK` | `window.playableSDK.openAppStore()` |
| Unity Ads | `mraid` | `mraid.open(storeUrl)` |

本配置统一管理 CTA 按钮的文案、位置、显示时机和平台 SDK 调用方式。

## Recipe

- **配置方式**：参数化（parametric）
- **核心参数**：
  - `defaultPlatform`: `"facebook"` — 默认目标平台
  - `ctaText`: `{ "zh": "立即下载", "en": "Install Now" }` — CTA 文案（多语言）
  - `ctaPosition`: `"bottom-center"` — CTA 按钮位置
  - `ctaShowAfterLevel`: `1` — 第几关后显示 CTA
  - `ctaAlwaysVisible`: `false` — 是否始终显示
  - `platforms`: 各平台 SDK 和方法的映射表
- **可 fork 变体**：
  - 激进型：`ctaAlwaysVisible: true`，始终显示 CTA
  - Google 优先：`defaultPlatform: "google"`, `ctaShowAfterLevel: 0`
  - TikTok 全屏点击：追加 `ctaFullScreenTap: true`

**配置步骤：**
1. 读取项目的 `game/config.json`
2. 写入 `cta` 配置块，包含默认平台、文案、位置
3. 写入 `cta.platforms` 子对象，包含各平台的 SDK 和调用方法
4. 确保 `cta.showAfterLevel` 与难度曲线的 `ctaTriggerAfterLevel` 一致

## Result

- **产物**：修改 `game/config.json` 的 CTA 配置块
- **格式**：JSON patch
- **目标键**：`cta`
- **包含子键**：`defaultPlatform`, `ctaText`, `ctaPosition`, `ctaShowAfterLevel`, `ctaAlwaysVisible`, `platforms`

## Binding

- **Binding Role**：`gameConfig`
- **挂载目标**：`game/config.json`
- **引用类型**：`config-key-value`
- **与其他 Skill 的关系**：
  - 与 `difficulty_curve_designer.aiconfig` 联动：CTA 触发时机应在峰值体验之后
  - 与 `ad_compliance_rules.aiconfig` 联动：CTA 实现必须符合各平台合规要求

## Skill Definition

tools:
  - read
  - write
prompt_extension: |
  You are configuring CTA (Call-to-Action) behavior for a playable ad.
  Each ad platform has its own SDK for triggering the app store redirect:
  - Facebook: FbPlayableAd.onCTAClick()
  - Google: ExitApi.exit()
  - TikTok: window.playableSDK.openAppStore()
  - Unity Ads: mraid.open(storeUrl)
  Read game/config.json and write the cta config block.
  The CTA button implementation in code should detect the platform at runtime
  and call the appropriate SDK method. Write a platform-agnostic wrapper function.
  Ensure ctaShowAfterLevel aligns with the difficulty curve's peak level.
