@aglyn/plugins-marketing 1.0.0-beta.228 → 1.0.0-beta.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +15 -15
- package/src/lib/components/campaign-conversions-card.js +23 -11
- package/src/lib/components/campaign-conversions-card.js.map +1 -1
- package/src/lib/components/campaign-list-zones.d.ts +33 -0
- package/src/lib/components/campaign-list-zones.js +30 -0
- package/src/lib/components/campaign-list-zones.js.map +1 -0
- package/src/lib/components/campaign-report-card.js +20 -3
- package/src/lib/components/campaign-report-card.js.map +1 -1
- package/src/lib/components/campaigns-card.js +42 -13
- package/src/lib/components/campaigns-card.js.map +1 -1
- package/src/lib/components/experiment-zones.d.ts +11 -0
- package/src/lib/components/experiment-zones.js.map +1 -1
- package/src/lib/components/host-experiments-card.component.js +5 -1
- package/src/lib/components/host-experiments-card.component.js.map +1 -1
- package/src/lib/components/host-overlays-card.component.js +139 -24
- package/src/lib/components/host-overlays-card.component.js.map +1 -1
- package/src/lib/components/marketing-insight-zones.d.ts +28 -0
- package/src/lib/components/marketing-insight-zones.js +30 -0
- package/src/lib/components/marketing-insight-zones.js.map +1 -0
- package/src/lib/components/overlay-zones.d.ts +84 -0
- package/src/lib/components/overlay-zones.js +38 -0
- package/src/lib/components/overlay-zones.js.map +1 -0
- package/src/lib/components/site-runtime.js +10 -1
- package/src/lib/components/site-runtime.js.map +1 -1
- package/src/lib/model/index.d.ts +1 -0
- package/src/lib/model/index.js +1 -0
- package/src/lib/model/index.js.map +1 -1
- package/src/lib/model/overlay-drafts.d.ts +97 -0
- package/src/lib/model/overlay-drafts.js +192 -0
- package/src/lib/model/overlay-drafts.js.map +1 -0
- package/src/lib/plugin.js +12 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/server/email-events.js +8 -0
- package/src/lib/server/email-events.js.map +1 -1
- package/src/lib/server/marketing-ai-capabilities.d.ts +24 -0
- package/src/lib/server/marketing-ai-capabilities.js +225 -0
- package/src/lib/server/marketing-ai-capabilities.js.map +1 -0
- package/src/lib/server/marketing-drafts.d.ts +86 -0
- package/src/lib/server/marketing-drafts.js +354 -0
- package/src/lib/server/marketing-drafts.js.map +1 -0
- package/src/lib/server/marketing-figures.d.ts +18 -0
- package/src/lib/server/marketing-figures.js +259 -1
- package/src/lib/server/marketing-figures.js.map +1 -1
- package/src/lib/server/overlay-figures.d.ts +36 -0
- package/src/lib/server/overlay-figures.js +158 -0
- package/src/lib/server/overlay-figures.js.map +1 -0
- package/src/lib/server.js +10 -0
- package/src/lib/server.js.map +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot-context";
|
|
20
|
+
import { definePluginZone } from "@aglyn/aglyn/plugin-manager/plugin-zones";
|
|
21
|
+
export const MARKETING_INSIGHTS_ZONE = definePluginZone('marketingInsights');
|
|
22
|
+
/** The report's zone, drawn through the shell's renderer, or nothing outside the shell. */ export function MarketingInsightsZone(props) {
|
|
23
|
+
const Slot = useConsoleWidgetSlot();
|
|
24
|
+
return Slot ? /*#__PURE__*/ _jsx(Slot, _extends({
|
|
25
|
+
slot: MARKETING_INSIGHTS_ZONE.id
|
|
26
|
+
}, props)) : null;
|
|
27
|
+
}
|
|
28
|
+
MarketingInsightsZone.displayName = 'MarketingInsightsZone';
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=marketing-insight-zones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/marketing/src/lib/components/marketing-insight-zones.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { useConsoleWidgetSlot } from '@aglyn/aglyn/app-utils/console-widget-slot-context'\nimport { definePluginZone } from '@aglyn/aglyn/plugin-manager/plugin-zones'\n\n/**\n * The zone a marketing report hosts in its header (AGL-3603): the\n * Conversions section and one campaign's report.\n *\n * A widget here explains the figures the page shows, in words. It is handed\n * the site the figures are one site's — the site picked on the\n * organization's Conversions section, the site a campaign email was sent as —\n * and what the page is about, and nothing else: the figures it reads are the\n * ones this plugin publishes to other plugins as figure readers\n * (`server/marketing-figures.ts`), never this page's documents. There is\n * nothing to apply and nothing a widget may write.\n */\n\n/** What the report a widget sits on is about. */\nexport type MarketingInsightSubject = 'conversions' | 'campaign'\n\n/** What {@link MARKETING_INSIGHTS_ZONE} hands each widget. */\nexport interface MarketingInsightsZoneProps {\n /** The site the figures are one site's; `null` when the page has none to name yet. */\n hostId: string | null\n subject: MarketingInsightSubject\n /** One campaign's report: the subject line it is known by. `null` elsewhere. */\n campaign: string | null\n}\n\nexport const MARKETING_INSIGHTS_ZONE =\n definePluginZone<MarketingInsightsZoneProps>('marketingInsights')\n\n/** The report's zone, drawn through the shell's renderer, or nothing outside the shell. */\nexport function MarketingInsightsZone(props: MarketingInsightsZoneProps) {\n const Slot = useConsoleWidgetSlot()\n return Slot ? <Slot slot={MARKETING_INSIGHTS_ZONE.id} {...props} /> : null\n}\nMarketingInsightsZone.displayName = 'MarketingInsightsZone'\n"],"names":["useConsoleWidgetSlot","definePluginZone","MARKETING_INSIGHTS_ZONE","MarketingInsightsZone","props","Slot","slot","id","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,oBAAoB,QAAQ,qDAAoD;AACzF,SAASC,gBAAgB,QAAQ,2CAA0C;AA2B3E,OAAO,MAAMC,0BACXD,iBAA6C,qBAAoB;AAEnE,yFAAyF,GACzF,OAAO,SAASE,sBAAsBC,KAAiC;IACrE,MAAMC,OAAOL;IACb,OAAOK,qBAAO,KAACA;QAAKC,MAAMJ,wBAAwBK,EAAE;OAAMH,UAAY;AACxE;AACAD,sBAAsBK,WAAW,GAAG"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { OverlayCopyField, OverlayCopyProposal, OverlayPopupTrigger } from '../model/overlay-drafts';
|
|
2
|
+
import type { HostOverlay } from '../model/overlays';
|
|
3
|
+
/**
|
|
4
|
+
* The two zones the overlays list hosts (AGL-3603).
|
|
5
|
+
*
|
|
6
|
+
* The overlays — announcement bars and popups — are this plugin's: the
|
|
7
|
+
* documents, their schedule, their targeting and the order a visitor meets
|
|
8
|
+
* them in. A plugin that can WRITE copy for one may not be imported here, so
|
|
9
|
+
* the list hosts two positions and says what each hands a widget, drawn by the
|
|
10
|
+
* console shell's own renderer with every gate a console page's slot applies.
|
|
11
|
+
*
|
|
12
|
+
* ## A widget proposes; this plugin writes
|
|
13
|
+
*
|
|
14
|
+
* {@link HOST_OVERLAYS_ZONE}, beside New bar and New popup, hands a widget
|
|
15
|
+
* `createOverlayDraft`. The list cuts what it is handed to the overlay's own
|
|
16
|
+
* limits, writes it SWITCHED OFF through the same site-wide write a typed
|
|
17
|
+
* overlay takes, and opens it in the editor. A visitor sees nothing until a
|
|
18
|
+
* person turns it on.
|
|
19
|
+
*
|
|
20
|
+
* {@link OVERLAY_EDITOR_ZONE}, among the editor's fields, hands a widget the
|
|
21
|
+
* copy as the editor holds it and `proposeValues`, which fills the editor's
|
|
22
|
+
* own fields unsaved. The editor's Save is the only write.
|
|
23
|
+
*/
|
|
24
|
+
/** The limits and the trigger catalog a widget writes inside, as the list hands them over. */
|
|
25
|
+
export interface MarketingOverlayRules {
|
|
26
|
+
limits: Readonly<Record<OverlayCopyField, number>>;
|
|
27
|
+
triggers: readonly OverlayPopupTrigger[];
|
|
28
|
+
}
|
|
29
|
+
/** What `createOverlayDraft` answers: the overlay it wrote, or why it wrote none. */
|
|
30
|
+
export type MarketingOverlayDraftResult = {
|
|
31
|
+
ok: true;
|
|
32
|
+
id: string;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
error: string;
|
|
36
|
+
};
|
|
37
|
+
/** What {@link HOST_OVERLAYS_ZONE} hands each widget. */
|
|
38
|
+
export interface MarketingHostOverlaysZoneProps extends MarketingOverlayRules {
|
|
39
|
+
hostId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Writes a new overlay of `kind` from `proposal`, switched off, and opens it
|
|
42
|
+
* in the editor. Refused when the proposal has nothing the overlay needs —
|
|
43
|
+
* a bar's text, a popup's body — or when the write fails.
|
|
44
|
+
*/
|
|
45
|
+
createOverlayDraft: (kind: HostOverlay['kind'], proposal: OverlayCopyProposal) => Promise<MarketingOverlayDraftResult>;
|
|
46
|
+
}
|
|
47
|
+
/** One overlay's copy as the editor holds it, as typed. */
|
|
48
|
+
export interface MarketingOverlayEditorCopy {
|
|
49
|
+
name: string;
|
|
50
|
+
/** A bar's text. */
|
|
51
|
+
text: string;
|
|
52
|
+
headline: string;
|
|
53
|
+
body: string;
|
|
54
|
+
ctaLabel: string;
|
|
55
|
+
ctaHref: string;
|
|
56
|
+
trigger: string;
|
|
57
|
+
triggerValue: number | null;
|
|
58
|
+
}
|
|
59
|
+
/** What {@link OVERLAY_EDITOR_ZONE} hands each widget. */
|
|
60
|
+
export interface MarketingOverlayEditorZoneProps extends MarketingOverlayRules {
|
|
61
|
+
hostId: string;
|
|
62
|
+
/** The overlay's id once it has been saved; empty while it is new. */
|
|
63
|
+
overlayId: string;
|
|
64
|
+
kind: HostOverlay['kind'];
|
|
65
|
+
copy: MarketingOverlayEditorCopy;
|
|
66
|
+
/**
|
|
67
|
+
* Fills the editor's fields with what a widget proposes, unsaved, cut to the
|
|
68
|
+
* limits; a trigger outside the catalog is ignored. `key` identifies the
|
|
69
|
+
* proposal so a widget can tell which of its own the editor is showing.
|
|
70
|
+
*/
|
|
71
|
+
proposeValues: (proposal: OverlayCopyProposal, key: string) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare const HOST_OVERLAYS_ZONE: import("@aglyn/aglyn/plugin-manager/plugin-zones").PluginZone<MarketingHostOverlaysZoneProps>;
|
|
74
|
+
export declare const OVERLAY_EDITOR_ZONE: import("@aglyn/aglyn/plugin-manager/plugin-zones").PluginZone<MarketingOverlayEditorZoneProps>;
|
|
75
|
+
/** The list's zone, drawn through the shell's renderer, or nothing outside the shell. */
|
|
76
|
+
export declare function HostOverlaysZone(props: MarketingHostOverlaysZoneProps): import("react").JSX.Element;
|
|
77
|
+
export declare namespace HostOverlaysZone {
|
|
78
|
+
var displayName: string;
|
|
79
|
+
}
|
|
80
|
+
/** The editor's zone, drawn through the shell's renderer, or nothing outside the shell. */
|
|
81
|
+
export declare function OverlayEditorZone(props: MarketingOverlayEditorZoneProps): import("react").JSX.Element;
|
|
82
|
+
export declare namespace OverlayEditorZone {
|
|
83
|
+
var displayName: string;
|
|
84
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot-context";
|
|
20
|
+
import { definePluginZone } from "@aglyn/aglyn/plugin-manager/plugin-zones";
|
|
21
|
+
export const HOST_OVERLAYS_ZONE = definePluginZone('hostOverlays');
|
|
22
|
+
export const OVERLAY_EDITOR_ZONE = definePluginZone('overlayEditor');
|
|
23
|
+
/** The list's zone, drawn through the shell's renderer, or nothing outside the shell. */ export function HostOverlaysZone(props) {
|
|
24
|
+
const Slot = useConsoleWidgetSlot();
|
|
25
|
+
return Slot ? /*#__PURE__*/ _jsx(Slot, _extends({
|
|
26
|
+
slot: HOST_OVERLAYS_ZONE.id
|
|
27
|
+
}, props)) : null;
|
|
28
|
+
}
|
|
29
|
+
HostOverlaysZone.displayName = 'HostOverlaysZone';
|
|
30
|
+
/** The editor's zone, drawn through the shell's renderer, or nothing outside the shell. */ export function OverlayEditorZone(props) {
|
|
31
|
+
const Slot = useConsoleWidgetSlot();
|
|
32
|
+
return Slot ? /*#__PURE__*/ _jsx(Slot, _extends({
|
|
33
|
+
slot: OVERLAY_EDITOR_ZONE.id
|
|
34
|
+
}, props)) : null;
|
|
35
|
+
}
|
|
36
|
+
OverlayEditorZone.displayName = 'OverlayEditorZone';
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=overlay-zones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/marketing/src/lib/components/overlay-zones.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { useConsoleWidgetSlot } from '@aglyn/aglyn/app-utils/console-widget-slot-context'\nimport { definePluginZone } from '@aglyn/aglyn/plugin-manager/plugin-zones'\nimport type {\n OverlayCopyField,\n OverlayCopyProposal,\n OverlayPopupTrigger,\n} from '../model/overlay-drafts'\nimport type { HostOverlay } from '../model/overlays'\n\n/**\n * The two zones the overlays list hosts (AGL-3603).\n *\n * The overlays — announcement bars and popups — are this plugin's: the\n * documents, their schedule, their targeting and the order a visitor meets\n * them in. A plugin that can WRITE copy for one may not be imported here, so\n * the list hosts two positions and says what each hands a widget, drawn by the\n * console shell's own renderer with every gate a console page's slot applies.\n *\n * ## A widget proposes; this plugin writes\n *\n * {@link HOST_OVERLAYS_ZONE}, beside New bar and New popup, hands a widget\n * `createOverlayDraft`. The list cuts what it is handed to the overlay's own\n * limits, writes it SWITCHED OFF through the same site-wide write a typed\n * overlay takes, and opens it in the editor. A visitor sees nothing until a\n * person turns it on.\n *\n * {@link OVERLAY_EDITOR_ZONE}, among the editor's fields, hands a widget the\n * copy as the editor holds it and `proposeValues`, which fills the editor's\n * own fields unsaved. The editor's Save is the only write.\n */\n\n/** The limits and the trigger catalog a widget writes inside, as the list hands them over. */\nexport interface MarketingOverlayRules {\n limits: Readonly<Record<OverlayCopyField, number>>\n triggers: readonly OverlayPopupTrigger[]\n}\n\n/** What `createOverlayDraft` answers: the overlay it wrote, or why it wrote none. */\nexport type MarketingOverlayDraftResult =\n | { ok: true; id: string }\n | { ok: false; error: string }\n\n/** What {@link HOST_OVERLAYS_ZONE} hands each widget. */\nexport interface MarketingHostOverlaysZoneProps extends MarketingOverlayRules {\n hostId: string\n /**\n * Writes a new overlay of `kind` from `proposal`, switched off, and opens it\n * in the editor. Refused when the proposal has nothing the overlay needs —\n * a bar's text, a popup's body — or when the write fails.\n */\n createOverlayDraft: (\n kind: HostOverlay['kind'],\n proposal: OverlayCopyProposal,\n ) => Promise<MarketingOverlayDraftResult>\n}\n\n/** One overlay's copy as the editor holds it, as typed. */\nexport interface MarketingOverlayEditorCopy {\n name: string\n /** A bar's text. */\n text: string\n headline: string\n body: string\n ctaLabel: string\n ctaHref: string\n trigger: string\n triggerValue: number | null\n}\n\n/** What {@link OVERLAY_EDITOR_ZONE} hands each widget. */\nexport interface MarketingOverlayEditorZoneProps extends MarketingOverlayRules {\n hostId: string\n /** The overlay's id once it has been saved; empty while it is new. */\n overlayId: string\n kind: HostOverlay['kind']\n copy: MarketingOverlayEditorCopy\n /**\n * Fills the editor's fields with what a widget proposes, unsaved, cut to the\n * limits; a trigger outside the catalog is ignored. `key` identifies the\n * proposal so a widget can tell which of its own the editor is showing.\n */\n proposeValues: (proposal: OverlayCopyProposal, key: string) => void\n}\n\nexport const HOST_OVERLAYS_ZONE =\n definePluginZone<MarketingHostOverlaysZoneProps>('hostOverlays')\n\nexport const OVERLAY_EDITOR_ZONE =\n definePluginZone<MarketingOverlayEditorZoneProps>('overlayEditor')\n\n/** The list's zone, drawn through the shell's renderer, or nothing outside the shell. */\nexport function HostOverlaysZone(props: MarketingHostOverlaysZoneProps) {\n const Slot = useConsoleWidgetSlot()\n return Slot ? <Slot slot={HOST_OVERLAYS_ZONE.id} {...props} /> : null\n}\nHostOverlaysZone.displayName = 'HostOverlaysZone'\n\n/** The editor's zone, drawn through the shell's renderer, or nothing outside the shell. */\nexport function OverlayEditorZone(props: MarketingOverlayEditorZoneProps) {\n const Slot = useConsoleWidgetSlot()\n return Slot ? <Slot slot={OVERLAY_EDITOR_ZONE.id} {...props} /> : null\n}\nOverlayEditorZone.displayName = 'OverlayEditorZone'\n"],"names":["useConsoleWidgetSlot","definePluginZone","HOST_OVERLAYS_ZONE","OVERLAY_EDITOR_ZONE","HostOverlaysZone","props","Slot","slot","id","displayName","OverlayEditorZone"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,oBAAoB,QAAQ,qDAAoD;AACzF,SAASC,gBAAgB,QAAQ,2CAA0C;AAmF3E,OAAO,MAAMC,qBACXD,iBAAiD,gBAAe;AAElE,OAAO,MAAME,sBACXF,iBAAkD,iBAAgB;AAEpE,uFAAuF,GACvF,OAAO,SAASG,iBAAiBC,KAAqC;IACpE,MAAMC,OAAON;IACb,OAAOM,qBAAO,KAACA;QAAKC,MAAML,mBAAmBM,EAAE;OAAMH,UAAY;AACnE;AACAD,iBAAiBK,WAAW,GAAG;AAE/B,yFAAyF,GACzF,OAAO,SAASC,kBAAkBL,KAAsC;IACtE,MAAMC,OAAON;IACb,OAAOM,qBAAO,KAACA;QAAKC,MAAMJ,oBAAoBK,EAAE;OAAMH,UAAY;AACpE;AACAK,kBAAkBD,WAAW,GAAG"}
|
|
@@ -18,7 +18,8 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
19
|
import * as Aglyn from "@aglyn/aglyn";
|
|
20
20
|
import { sendAnalyticsBeacon } from "@aglyn/aglyn/app-utils/analytics-beacon";
|
|
21
|
-
import { trackAuthoredEvent, trackEvent } from "@aglyn/aglyn/app-utils/analytics-events";
|
|
21
|
+
import { resolveAuthoredEventName, trackAuthoredEvent, trackEvent } from "@aglyn/aglyn/app-utils/analytics-events";
|
|
22
|
+
import { recordSiteJourneyStep } from "@aglyn/aglyn/app-utils/site-journey";
|
|
22
23
|
import { claimFirstCampaignTouch, notePageCampaigns, utmTouchField, whenUtmTouchConsentSettles } from "@aglyn/aglyn/app-utils/utm-touch";
|
|
23
24
|
import { useEffect, useRef, useState } from "react";
|
|
24
25
|
import * as MarketingModel from "../model/index.js";
|
|
@@ -38,6 +39,10 @@ import * as MarketingModel from "../model/index.js";
|
|
|
38
39
|
}, overlayId ? {
|
|
39
40
|
overlayId
|
|
40
41
|
} : {}));
|
|
42
|
+
// A funnel step (AGL-3605): a click on a bar or popup, by the overlay.
|
|
43
|
+
if (overlay === 'barClick' || overlay === 'popupClick') {
|
|
44
|
+
recordSiteJourneyStep('overlay', overlayId);
|
|
45
|
+
}
|
|
41
46
|
// GA mirror (wave v8): sites with Analytics configured see overlay
|
|
42
47
|
// engagement in their own property; no-op without gtag.
|
|
43
48
|
//
|
|
@@ -378,6 +383,10 @@ import * as MarketingModel from "../model/index.js";
|
|
|
378
383
|
// shared sanitizer and the reserved-name refusal like everything
|
|
379
384
|
// else, never raw gtag.
|
|
380
385
|
trackAuthoredEvent(step.eventName, step.params);
|
|
386
|
+
// A funnel step (AGL-3605), under the name GA would receive; a
|
|
387
|
+
// name GA would refuse is no step either.
|
|
388
|
+
const journeyEvent = resolveAuthoredEventName(step.eventName).name;
|
|
389
|
+
if (journeyEvent) recordSiteJourneyStep('event', journeyEvent);
|
|
381
390
|
} else if (step.type === 'siteAlert') {
|
|
382
391
|
var _step_message, _step_severity;
|
|
383
392
|
showToast(String((_step_message = step.message) != null ? _step_message : '').slice(0, 300), (_step_severity = step.severity) != null ? _step_severity : 'info');
|