Skip to content

Commit

Permalink
feat(@dpc-sdp/nuxt-ripple-analytics): add content status to routeChan…
Browse files Browse the repository at this point in the history
…ge event
  • Loading branch information
David Featherston committed Sep 16, 2024
1 parent c947849 commit 91d408c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/nuxt-app/test/features/site/analytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/nuxt-app/test/fixtures/landingpage/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt-ripple-analytics/lib/routeChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt-ripple-analytics/lib/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 91d408c

Please sign in to comment.