| [ Web Proxy ] |
| Viewing: https://docs.lytics.com/docs/contentstack | [Back] [Original] |
Contentstack is a composable foundation for driving best-in-class personalized experiences. Contentstack provides an API-first CMS platform to drive the delivery of the best content to everywhere it needs to be.
Integrating Contentstack and Lytics allows you to connect content from your CMS to:
If you haven't already done so, you'll need to set up a Contentstack account before you begin the process described below.
Once created, you'll add new Authorizations in Lytics for Contentstack by navigating to "Account > Authorizations > Create New" and select Contentstack as the provider.
Syncing your entry metadata to Lytics requires a Contentstack API Key for your desired stack Stack.
Select "Stack API Key".
Add your Contentstack Region, Stack API Key, Delivery Token and Management Token.
Click "Complete".
Syncing profiles to Contentstack Personalize requires you to first generate an authtoken from Contentstack. Then, you'll add that authtoken as a new Lytics authorization.
Select Contentstack Authtoken.
Add your authtoken and the region of your Personalize Project.
Click "Complete".
Once you've created an Authorization for Contentstack, you'll start a Contentstack "Import Entries" job in Lytics to sync your entries and taxonomy with your Lytics Content Graph.
Navigate to "Data Pipeline > Jobs > Create New" and select Contentstack as the provider.
Select the "Import Entries" job type and then select your content types to import (likely "article", "landing page", not "navigation", etc.). You can select multiple content types to import their entries.
Select Keep Updated to continuously import the entries for selected content types.
You can also provide the domain (optional) on which you are serving content and have the JavaScript Tag installed.
Select the Taxonomies you'd like to import. Each taxonomy selected will create a new Context Layer and calculate new scores on profiles for each value in that taxonomy.
Click "Complete".
See "Manual Installation" below for details on how to manually configure all aspects to the website (tag) based sync with Contentstack.
Once you've imported your Contentstack entries into Lytics, you'll want to enable Lytics' JavaScript Tag to sync profile data with Contentstack's Personalize Edge API.
Navigate to "Account > Settings > JavaScript Tag".
Enter the Base URL for the data center to which you want to send to Contentstack's Personalize Edge API, and your Personalize Project ID.
Click "Save".
Once connected, you'll be able to use any Lytics Audience as Contentstack Audience to help tailor content for different audiences, manage variants, and run A/B tests to enhance engagement and conversions.
Export Lytics audience defintions to create the personalize audience in Contentstack by starting the Sync Audience Defintions job.
Navigate to "Data Pipeline > Jobs > Create New" and select Contentstack as the provider.
Select the "Sync Audience Definitions" job type.
Select the authorizations you would like to use.
Select your Contentstack organization.
Select the Personalize project where you would like to send the Lytics audience definitions.
Click "Complete".
This following explains how to enable and use the Contentstack integrations available in JSTag3. There are two distinct plugins available: Contentstack Sync and Contentstack Push.
Contentstack Sync
cs-lytics-audiences, cs-lytics-flows) that get passed to the edge on each request and leverages "Live Attributes" within Contentstack PersonalizeContentstack Push
Both plugins are disabled by default and must be explicitly enabled in your JSTag configuration or via supported account settings.
window.jstag.config({
contentstack: {
entitySync: {
disabled: false, // Enable the sync plugin
cookie: "cs-personalize-user-uid", // Main user ID cookie name
segmentsCookie: "cs-lytics-audiences", // Cookie for audience data
flowsCookie: "cs-lytics-flows", // Cookie for flow data
stateCookiesMaxAge: 604800, // Cookie expiration (7 days in seconds)
cookieDomain: null, // Cookie domain (null = current domain)
poll: {
disabled: true, // Disable automatic polling
initialDelay: 4000, // Initial delay before first poll (ms)
maxAttempts: 5, // Maximum polling attempts
},
cache: {
disabled: false, // Enable session storage caching
storage: sessionStorage, // Storage mechanism
key: "contentstack_personalize", // Cache key name
},
},
},
});window.jstag.config({
contentstack: {
entityPush: {
disabled: false, // Enable the push plugin
baseUrl: "https://personalize-edge.contentstack.com", // Contentstack API endpoint
personalizeProjectId: "your-project-id", // Your Contentstack project ID(s)
audienceAttribute: "lytics_audiences", // Attribute name for audiences
flowAttribute: "lytics_flows", // Attribute name for flows
cookie: "cs-personalize-user-uid", // User ID cookie name
cookieDomain: null, // Cookie domain
poll: {
disabled: true, // Disable automatic polling
initialDelay: 4000, // Initial delay (ms)
maxAttempts: 5, // Maximum attempts
},
cache: {
disabled: false, // Enable caching
storage: sessionStorage, // Storage type
key: "contentstack_personalize", // Cache key
},
},
},
});// Minimal configuration for Contentstack Sync
window.jstag.config({
contentstack: {
entitySync: {
disabled: false,
},
},
});This will:
cs-personalize-user-uid) when entity data is loadedcs-lytics-audiences) with pipe-delimited segment datacs-lytics-flows) with pipe-delimited flow step data// Minimal configuration for Contentstack Push
window.jstag.config({
contentstack: {
entityPush: {
disabled: false,
personalizeProjectId: "your-contentstack-project-id",
},
},
});This will:
// Enable automatic polling for real-time updates
window.jstag.config({
contentstack: {
entitySync: {
disabled: false,
cookieDomain: ".yourdomain.com", // Set cookies for entire domain
poll: {
disabled: false, // Enable polling
initialDelay: 5000, // Wait 5 seconds before first poll
maxAttempts: 10, // Poll up to 10 times
},
},
},
});// Push to multiple Contentstack projects
window.jstag.config({
contentstack: {
entityPush: {
disabled: false,
personalizeProjectId: ["project-id-1", "project-id-2", "project-id-3"],
},
},
});Both plugins format audience and flow data consistently:
["segment1", "segment2", "segment3"]"|segment1|segment2|segment3|"{"flow1": "step2", "flow2": "step1"}"|step1|step2|"The data is:
// Monitor polling status (both plugins)
window.jstag.on("contentstack.entitySync.pollStarted", function() {
console.log("Polling started");
});
window.jstag.on("contentstack.entitySync.pollStopped", function() {
console.log("Polling stopped");
});No cookies are set (Sync)
disabled: false in configurationAPI requests failing (Push)
personalizeProjectId is correctPolling not working
poll.disabled: false in configuration// Enable debug logging
window.jstag.config({
audit: {
disabled: false, // This enables console logging for troubleshooting
},
});Updated 11 months ago
| Web Proxy Viewer | New URL | Original Page |