Community研究與資料分析github.com

Croct 平台整合與遷移

將 Croct 與第三方平台(如 Storyblok、Shopify、HubSpot)連接,或從其他個人化/實驗工具(如 Mutiny、Ninetailed)遷移至 Croct。

Croct 平台整合與遷移 是什麼?

此技能專注於 Croct 與各種第三方平台的整合及遷移。它涵蓋的範圍包括:透過 SDK 或 CDN 腳本將事件、個人資料屬性「饋入」Croct;將 Croct 體驗資料傳送至 Microsoft Clarity 等分析工具;以及在 CMS 或 HubSpot 表單等平台中,使用 Slots 渲染個人化內容。此外,它也提供從 Mutiny 或 Ninetailed 等其他工具遷移的逐步指南。支援的平台包括 Storyblok、Sanity、Strapi、Shopify、VTEX、Google Tag Manager,以及 6sense、Demandbase 等企業資訊提供者。技能文件提供了一份清晰的整合對照表,指導使用者選擇安裝方法(CLI 或手動腳本),並強調整合必須基於已安裝的 Croct SDK。文件中也包含重要的跨領域規則,例如:CMS 內容應作為 Slots 的備援、設定目標追蹤應早於發佈體驗,以及企業資訊資料在首次頁面瀏覽時還不可用。對於每個整合,都有對應的詳細參考文件作為操作指引。

相容平台~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),或是在平台的內容中渲染 Slot 內容(CMS、HubSpot 表單 ID)。遷移則是用 Slots 取代其他工具的標記或體驗。

選擇整合項目

平台 / 目標整合功能安裝方法參考文件
StoryblokOptimize 應用程式將區塊連結至 Slots;SDK 在擷取故事時交換連結區塊(JS、PHP)Storyblok 應用程式 + croct init 或 @croct/plug-storyblok / croct/plug-storyblokstoryblok.md
Sanity使用 Sanity 內容作為 fallback 的 Slot 擷取;無需 Croct 套件croct init + fetchContentheadless-cms.md
Strapi透過映射 Slot 將動態區域元件對應至 Slotscroct 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 表單提交目標、個人資料豐富化、透過 Slot 提供的表單 ID 用於測試圍繞 HubSpot 嵌入的程式碼analytics-and-crm.md
6sense, Demandbase將豐富的 firmographics 屬性寫入個人資料Croct 腳本或 GTMfirmographics.md
Clearbit Reveal, ZoomInfo WebSights透過您新增的程式碼將公司屬性寫入個人資料GTM 自訂 HTMLfirmographics.md
從 Mutiny, Ninetailed 遷移概念映射和逐步替換為 Slots、受眾、實驗croct init + 每個區域的 Slotsmigrations.md

僅閱讀與當前平台相關的參考文件。如果未列出該平台,則表示文件沒有專屬的整合方式:請告知使用者,並在自行嘗試前檢查 https://docs.croct.com/llms.txt。

跨領域規則

  1. SDK 優先。 每個整合都需要在頁面或伺服器上安裝 Croct SDK。沒有它,整合腳本將無法運作。請使用 croct init 進行設定,或參閱 croct-integrate-sdk 技能。
  2. 優先使用 croct init 來處理 Storyblok、Sanity、Strapi、Hydrogen 和遷移。它會偵測技術堆疊並連接 SDK(對於 Storyblok JS,它會將 storyblokInit 包裝在 withCroct 中)。僅在使用者要求,或 CLI 無法連接時(例如,在不支援框架的 PHP Storyblok 環境中),才使用手動步驟。
  3. CMS 內容始終作為備援。 將現有的 CMS 或硬編碼內容作為 fallback 傳遞,以便在請求失敗或緩慢時仍能渲染當前頁面。對於 Sanity、Strapi 和 Ninetailed,請詢問使用者預設內容應存放於何處(Croct(建議)或 CMS,透過 metadata.contentSource === 'slot' 設定)。請參閱 headless-cms.md。
  4. Croct 元件鏡像 CMS 結構描述,使用相同的屬性名稱,因此 Slot 內容和 CMS 內容可在相同的渲染元件中互換使用。
  5. 在發佈任何體驗或實驗之前,先追蹤目標,否則早期資料會顯示曝光但無轉換。
  6. 企業資訊資料在首次頁面瀏覽時不可用。 設計帳戶為基礎的體驗時,應使其在後續頁面瀏覽時啟動;首次印象可使用廣告活動、參照連結網址或地理位置。
  7. CQL 中的自訂屬性需移除 custom. 前綴: custom.firmographics.profile.industry 應寫為 user's firmographics's profile's industry。個人資料最多允許 10 個自訂屬性。對於超出這些範例的情況,請參閱 croct-cql 技能。
  8. Storyblok 特定事項: Optimize 需要 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 預覽版,或非商店前端子網域的結帳網域上運作(文件已說明此 Hydrogen 的注意事項)。
  • 請勿對 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=<搜尋詞彙>

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?".

相關技能