Community研究与数据分析github.com

Croct平台集成与迁移技能

用于将Croct连接到第三方平台或从其他个性化/实验工具迁移到Croct。涵盖Storyblok、Sanity、Strapi、Shopify、VTEX、Google Tag Manager、Microsoft Clarity、HubSpot、企业特征提供商(6sense、Demandbase等)以及从Mutiny和Ninetailed的迁移。

Croct平台集成与迁移技能 是什么?

此技能为AI代理提供了一套完整指南,用于将Croct个性化平台集成到各种第三方工具,或从其他类似工具迁移。它定义了一个可操作的框架,通过CDN脚本、SDK包装器(如@croct/plug-storyblok)和GTM自定义HTML标签,将Croct与CMS(Storyblok、Sanity、Strapi)、电商平台(Shopify、VTEX)、分析工具(Google Tag Manager、Microsoft Clarity)和CRM(HubSpot)连接。该技能还支持来自6sense、Demandbase、Clearbit Reveal和ZoomInfo WebSights的企业特征数据,用于基于账户的个性化。此外,它提供了从Mutiny和Ninetailed迁移的逐步说明,概念映射和最佳实践(如SDK优先、CMS内容作为回退、跟踪目标在前)。它附带了详细的参考文件,按平台分类,并包含跨领域规则,例如不要为6sense发明属性名称,不要使用SDK跟踪Shopify结账,以及不要从Mutiny或Ninetailed导入受众。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/croct-tech/agent-skills/tree/HEAD/skills/croct-integrate-platforms

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Croct平台集成与迁移

此处的每个集成都建立在有效的Croct SDK之上。它们要么输入数据(事件、用户画像属性),要么输出Croct数据(Clarity),要么在平台内容中渲染槽位内容(CMS、HubSpot表单ID)。迁移则用槽位替换其他工具的标识或体验。

选择集成方式

平台/目标集成功能安装方法参考文档
Storyblok优化应用将块链接到槽位;SDK在故事获取期间交换链接块(JS、PHP)Storyblok应用 + croct init 或 @croct/plug-storyblok / croct/plug-storyblokstoryblok.md
Sanity使用Sanity内容作为fallback进行槽位获取;无Croct包croct init + fetchContentheadless-cms.md
Strapi通过映射槽位将动态区域组件映射到槽位croct init + fetchContentheadless-cms.md
Shopify Hydrogen自动商店前台事件、客户识别;SDK使用位于croct-integrate-sdk技能中croct init(Hydrogen SDK)ecommerce.md
Shopify 结账/订单(Liquid或Hydrogen)自定义像素跟踪checkoutStarted、orderPlaced,以及自定义事件商店前台插件 + Shopify自定义像素ecommerce.md
Shopify Liquid主题用于内容的JavaScript SDK;用于事件的GTM集成;用于结账的像素脚本标签ecommerce.md
VTEX Store Framework(VTEX IO)将商店事件转发为目标和电商事件;丰富用户画像vtex.js脚本或GTMecommerce.md
Google Tag Manager / GA4数据层将推荐的数据层事件转发为目标和电商事件google-tag-manager.js脚本或GTManalytics-and-crm.md
Microsoft Clarity使用Croct体验、受众、实验变体标记Clarity会话clarity.js脚本或GTManalytics-and-crm.md
HubSpot表单提交目标、用户画像丰富、从槽位提供表单ID以进行测试HubSpot嵌入周围的代码analytics-and-crm.md
6sense、Demandbase将丰富的firmographics属性写入用户画像Croct脚本或GTMfirmographics.md
Clearbit Reveal、ZoomInfo WebSights通过您添加的代码将公司属性写入用户画像GTM自定义HTMLfirmographics.md
从Mutiny、Ninetailed迁移概念映射和逐步替换为槽位、受众、实验croct init + 按区域槽位migrations.md

仅阅读当前平台的参考文档。如果平台未列出,则说明文档没有专用集成:请先说明,并在即兴操作前检查https://docs.croct.com/llms.txt。

跨领域规则

  1. SDK优先。 每个集成都需要页面上或服务器上的Croct SDK。没有SDK,集成脚本无法工作。使用croct init进行设置,或参见croct-integrate-sdk技能。
  2. 优先使用croct init 用于Storyblok、Sanity、Strapi、Hydrogen和迁移。它会检测技术栈并连接SDK(对于Storyblok JS,会用withCroct包装storyblokInit)。仅当用户要求或CLI无法连接时(例如,在不支持的框架上使用PHP Storyblok),才使用手动步骤。
  3. CMS内容始终是回退。 将现有的CMS或硬编码内容作为fallback传递,以便失败或缓慢的请求仍能渲染当前页面。对于Sanity、Strapi和Ninetailed,询问用户默认内容应放在哪里(Croct(推荐)还是通过metadata.contentSource === 'slot'保留在CMS中)。参见headless-cms.md。
  4. Croct组件镜像CMS模式,使用相同的属性名称,因此槽位内容和CMS内容在相同的渲染组件中可互换。
  5. 在发布任何体验或实验之前跟踪目标,否则早期数据会显示曝光但无转化。
  6. 企业特征数据在首次页面浏览时不可用。 设计基于账户的体验以在后续页面浏览时激活;首次印象使用活动、引荐来源或位置。
  7. CQL中的自定义属性省略custom.前缀: custom.firmographics.profile.industry 变为 user's firmographics's profile's industry。用户画像最多允许10个自定义属性。超出这些示例的任何内容,请参见croct-cql技能。
  8. Storyblok特定: 优化需要Scale计划和Storyblok供应商批准(通过Croct支持)。表格和引用字段无法个性化。

CDN集成脚本

所有脚本从https://cdn.croct.io/plug-integration/加载:

脚本加载位置加载时机
google-tag-manager.js<head> 或 <body>,或GTM任何时间;重放数据层
clarity.js<head> 或 <body>,或GTM任何时间;等待Clarity
vtex.js<head> 或 <body>,或GTM尽可能早;较早的事件会丢失
6sense.js、demandbase.js<head> 或 <body>,或GTM等待提供商识别访客
shopify-pixel.jsLiquid layout/theme.liquid 中 </head> 之前,带 defer任何时间;加载时向SDK注册
shopify-pixel-tracker.js在Shopify自定义像素内部导入不适用

GTM标签配方(转述给用户)

对于上述“通过GTM”提供的任何脚本:标签 > 新建;命名(例如,“将数据层事件发送到Croct”);标签类型自定义HTML;粘贴 <script src="..."> 标签;触发器 初始化 - 所有页面;保存,然后提交以发布容器。

工作流程

  1. 从表格中确定平台和目标;打开其参考文档。
  2. 确认其中列出的前提条件(账户、SDK、提供商标签、计划)。
  3. 进行代码更改。将仪表盘步骤(Storyblok应用、Shopify管理后台、GTM、Croct管理应用)留给用户作为简洁的清单;代理无法执行这些步骤。
  4. 向用户提供参考文档中的验证步骤。

询问并停止

  • 如果仓库未明确说明,询问网站使用的是哪个SDK或框架。
  • 对于CMS集成和Ninetailed:询问默认内容是应放在Croct还是CMS中。
  • 对于Shopify像素:询问它应对所有访客运行,还是仅在分析同意后运行。这是用户的法律决定。
  • 对于企业特征:询问他们许可了哪个提供商。不要添加他们没有的提供商标签。

禁止事项

  • 不要为6sense或Demandbase发明属性名称;使用参考文档中的表格。
  • 不要尝试使用SDK跟踪Shopify结账;结账时不运行商店前台脚本。使用像素。
  • 在Hydrogen上,不要期望Shopify像素在localhost、Oxygen预览或不是商店前台子域的结账域名上工作(文档说明了此注意事项)。
  • 不要对FastStore使用VTEX脚本;使用GTM集成。
  • 不要从Mutiny或Ninetailed导入受众;文档说明它们已在CQL中重写。
  • 不要迁移文档中没有迁移指南的工具(仅存在Mutiny和Ninetailed);先说明并检查https://docs.croct.com/llms.txt。

实时文档

  • 索引:https://docs.croct.com/llms.txt
  • 任何页面的Markdown格式:附加.md,例如 https://docs.croct.com/immersion/integrations/ecommerce/vtex.md
  • 搜索:https://docs.croct.com/api/search.md?term=<terms>

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

croct-tech/agent-skills

>- Use when writing, reading, reviewing, or debugging Croct's Contextual Query Language (CQL): audience criteria, `croct.evaluate()` / `useEvaluation` / `<Personalization query>` / Next.js `cql` tag queries, Evaluation API `query` bodies (`/client/web/evaluate`, `/external/web/evaluate`), and dynamic content values (`"type": "dynamic"`, `"expression"`). Covers context variables (user, session, page, location, campaign, cart, device, browser, context, now/today), data types and conversions, accessors and selectors (`'s`, `property X of`, `[1st]`, `[*]`, `[...]`), tests (`is`, `matches`, `is like`, `contains either`, `is between`, `is defined`, `is returning`), quantifiers (`some ... satisfies`), macros, modifiers, event expressions (`user has viewed a page`, `user has abandoned a cart`, `user has completed goal`), audience estimation, and recipes. Triggers: "write an audience", "target mobile users in New York", "CQL syntax error", "audience never matches", "unavailable estimate".

croct-tech/agent-skills

>- Use when installing or using a Croct SDK in application code: rendering slot content, evaluating CQL queries, server or client fetching, prerendering, identifying users, app ID / API key env vars, testing, or debugging. Covers JavaScript (`@croct/plug`, `croct.fetch`, `croct.evaluate`), React (`@croct/plug-react`, `<CroctProvider>`, `useContent`, `<Slot>`, `useEvaluation`, `useCroct`), Next.js (`@croct/plug-next`, `fetchContent`, `cql`, middleware/proxy, `NEXT_PUBLIC_CROCT_APP_ID`, `CROCT_API_KEY`), Vue (`@croct/plug-vue`), Nuxt (`@croct/plug-nuxt`), Shopify Hydrogen (`@croct/plug-hydrogen`), PHP (`croct/plug-php`), Laravel, Symfony, and Drupal. Triggers: slot IDs like `home-hero@1`, `SlotContent`, "Croct is not plugged in", "initial content is required for server-side rendering", "Did you forget to configure Croct's middleware?", CORS errors.

croct-tech/agent-skills

>- Use when designing or changing Croct content models: regular vs union components, what becomes a component, slot, structure, or primitive attribute; writing component schema JSON (`structure`, `union`, `reference`, `text`, `number`, `boolean`, `list`, `@croct/file`, `@croct/richText` rich text, `format`, `choices`, `optional`, `private`, `position`); writing content definition JSON (`static`/`dynamic` values, `nullable`, `default`, `{{placeholder}}` paths); slot default, localized, experience, experiment, or content group content; schema limit errors (30 attributes, 6 nesting levels, 10 union members, complexity score 50); component versioning and breaking changes (`home-hero@2`); refactoring (duplicate and modify, duplicate and replace, flatten and merge); Markdown in text attributes with `@croct/md-lite`. Phrasings: "model content for a hero", "add an attribute to the banner component", "support variations", "component is too complex", "localize the hero", "translations", `preferredLocale`.

croct-tech/agent-skills

>- Use when planning or implementing personalization or A/B testing with Croct: creating an experience (audience, slots, content, priority, scheduling, drafts), adding an experiment (A/B/n, primary goal ID, traffic allocation, variants, cross-device consistency), wiring the code it needs (slots, `croct.track('goalCompleted', {goalId})`, `orderPlaced`, `leadGenerated`, `userSignedUp`), server-side feature-flag experiments, redirect experiments, personalization recipes (UTM campaigns, ABM, search terms, location, free shipping, interests, blog readers, leads, customers, organic intent, HubSpot forms), or reading the experience, experiment, application, or workspace dashboards (probability to be best, potential loss, "Experiment in progress", "Recommended winner", "No clear winner", "Track your goal"). Phrasings: "personalize the hero for LinkedIn visitors", "A/B test this CTA", "which variant won?", "why does my experiment show no conversions?".

相关技能