Skip to content

Commit 6c42272

Browse files
authored
Merge pull request #2434 from contentstack/fix/variant
fix: added filter for lytics audience
2 parents 0654d88 + 2a2c48f commit 6c42272

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/contentstack-variants/src/import/audiences.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,16 @@ export default class Audiences extends PersonalizationAdapter<ImportConfig> {
8989
}
9090
log.debug(`Processing audience: ${name} (${uid})`, this.config.context);
9191

92+
// Skip Lytics audiences - they cannot be created via API (synced from Lytics)
93+
if ((audience as any).source?.toUpperCase() === 'LYTICS') {
94+
log.debug(`Skipping Lytics audience: ${name} (${uid})`, this.config.context);
95+
this.updateProgress(true, `audience: ${name} (skipped - Lytics)`, undefined, PROCESS_NAMES.AUDIENCES);
96+
continue;
97+
}
98+
9299
try {
93100
//check whether reference attributes exists or not
94-
if (definition.rules?.length) {
101+
if (definition?.rules?.length) {
95102
log.debug(
96103
`Processing ${definition.rules.length} definition rules for audience: ${name}`,
97104
this.config.context,

0 commit comments

Comments
 (0)