diff --git a/examples/nuxt-app/test/features/site/analytics.feature b/examples/nuxt-app/test/features/site/analytics.feature index 18110e28e5..960c6fd007 100644 --- a/examples/nuxt-app/test/features/site/analytics.feature +++ b/examples/nuxt-app/test/features/site/analytics.feature @@ -6,8 +6,8 @@ Feature: Analytics And the page endpoint for path "/" returns fixture "/landingpage/home" with status 200 Given I visit the page "/" Then the dataLayer should include the following events - | event | page_title | page_url | content_type | - | routeChange | Demo Landing Page | / | landing_page | + | event | page_title | page_url | content_type | content_status | + | routeChange | Demo Landing Page | / | landing_page | published | @mockserver Scenario: DataLayer - breadcrumbs diff --git a/examples/nuxt-app/test/fixtures/landingpage/home.json b/examples/nuxt-app/test/fixtures/landingpage/home.json index 96e9373f7c..d9f49b2691 100644 --- a/examples/nuxt-app/test/fixtures/landingpage/home.json +++ b/examples/nuxt-app/test/fixtures/landingpage/home.json @@ -3,6 +3,7 @@ "changed": "2022-11-02T12:47:29+11:00", "created": "2022-11-02T12:47:29+11:00", "type": "landing_page", + "status": "published", "nid": "11dede11-10c0-111e1-1100-000000000330", "showTopicTags": true, "topicTags": [ diff --git a/packages/nuxt-ripple-analytics/lib/routeChange.ts b/packages/nuxt-ripple-analytics/lib/routeChange.ts index 078a0f7f16..5a323aa5e6 100644 --- a/packages/nuxt-ripple-analytics/lib/routeChange.ts +++ b/packages/nuxt-ripple-analytics/lib/routeChange.ts @@ -10,6 +10,7 @@ export default function ({ route, site, page }): IRplAnalyticsEventPayload { page_title: page?.title, page_url: route.fullPath, content_type: page?.type, + content_status: page?.status, publication_name: page?.publication?.text, search_term: trimValue(route.query?.q), site_section: page?.siteSection?.name, diff --git a/packages/nuxt-ripple-analytics/lib/tracker.ts b/packages/nuxt-ripple-analytics/lib/tracker.ts index ec0773e317..86b983f8f8 100644 --- a/packages/nuxt-ripple-analytics/lib/tracker.ts +++ b/packages/nuxt-ripple-analytics/lib/tracker.ts @@ -31,6 +31,7 @@ export interface IRplAnalyticsEventPayload { // Route properties status_code?: number content_type?: string + content_status?: string search_term?: string site_section?: string publication_name?: string