This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make story data into an external component
- Loading branch information
1 parent
6e54fab
commit d10b926
Showing
7 changed files
with
36 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
packages/marko-web-native-x/components/story/track-end-of-content.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value"; | ||
import { get, getAsObject } from "@parameter1/base-cms-object-path"; | ||
|
||
$ const { req } = out.global; | ||
$ const story = getAsObject(input, "story"); | ||
$ const push = defaultValue(input.push, false); | ||
|
||
<if(push)> | ||
<marko-web-gtm-push name="dataLayerNativeX" data={ | ||
story_id: story.id, | ||
page_path: req.path, | ||
page_title: story.title, | ||
publisher_id: get(story, "publisher.id"), | ||
advertiser_id: get(story, "advertiser.id"), | ||
preview_mode: Boolean(req.query.preview), | ||
} /> | ||
</if> | ||
|
||
<marko-web-browser-component name="NativeXTrackEndOfContent" props={} /> |
13 changes: 13 additions & 0 deletions
13
packages/marko-web-native-x/components/story/track-init.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { get, getAsObject } from "@parameter1/base-cms-object-path"; | ||
|
||
$ const { req } = out.global; | ||
$ const story = getAsObject(input, "story"); | ||
|
||
<marko-web-gtm-push name="dataLayerNativeX" data={ | ||
story_id: story.id, | ||
page_path: req.path, | ||
page_title: story.title, | ||
publisher_id: get(story, "publisher.id"), | ||
advertiser_id: get(story, "advertiser.id"), | ||
preview_mode: Boolean(req.query.preview), | ||
} /> |
18 changes: 0 additions & 18 deletions
18
packages/marko-web-native-x/components/story/track-outbound-links.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value"; | ||
import { get, getAsObject } from "@parameter1/base-cms-object-path"; | ||
|
||
$ const { req } = out.global; | ||
$ const story = getAsObject(input, "story"); | ||
$ const push = defaultValue(input.push, false); | ||
|
||
<if(push)> | ||
<marko-web-gtm-push name="dataLayerNativeX" data={ | ||
story_id: story.id, | ||
page_path: req.path, | ||
page_title: story.title, | ||
publisher_id: get(story, "publisher.id"), | ||
advertiser_id: get(story, "advertiser.id"), | ||
preview_mode: Boolean(req.query.preview), | ||
} /> | ||
</if> | ||
|
||
<marko-web-browser-component name="NativeXTrackOutboundLinks" props={ | ||
container: input.container, | ||
} /> |
18 changes: 0 additions & 18 deletions
18
packages/marko-web-native-x/components/story/track-page-view.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value"; | ||
import { get, getAsObject } from "@parameter1/base-cms-object-path"; | ||
|
||
$ const { req } = out.global; | ||
$ const story = getAsObject(input, "story"); | ||
$ const push = defaultValue(input.push, true); | ||
|
||
<if(push)> | ||
<marko-web-gtm-push name="dataLayerNativeX" data={ | ||
story_id: story.id, | ||
page_path: req.path, | ||
page_title: story.title, | ||
publisher_id: get(story, "publisher.id"), | ||
advertiser_id: get(story, "advertiser.id"), | ||
preview_mode: Boolean(req.query.preview), | ||
} /> | ||
</if> | ||
|
||
<marko-web-gtm-push name="dataLayerNativeX" data={ event: "page_load" } /> |
18 changes: 0 additions & 18 deletions
18
packages/marko-web-native-x/components/story/track-social-share.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value"; | ||
import { get, getAsObject } from "@parameter1/base-cms-object-path"; | ||
|
||
$ const { req } = out.global; | ||
$ const story = getAsObject(input, "story"); | ||
$ const push = defaultValue(input.push, false); | ||
|
||
<if(push)> | ||
<marko-web-gtm-push name="dataLayerNativeX" data={ | ||
story_id: story.id, | ||
page_path: req.path, | ||
page_title: story.title, | ||
publisher_id: get(story, "publisher.id"), | ||
advertiser_id: get(story, "advertiser.id"), | ||
preview_mode: Boolean(req.query.preview), | ||
} /> | ||
</if> | ||
|
||
<marko-web-browser-component name="NativeXTrackSocialShare" props={} /> |