Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #952 from Shinsina/scroll-depth-native-story
Browse files Browse the repository at this point in the history
Correctly utilize Mindful config for scroll depth tracking on Mindful Advertising Posts
  • Loading branch information
brandonbk authored Aug 24, 2024
2 parents fa1d945 + defb265 commit 68a5f4c
Showing 1 changed file with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,36 @@ $ const {
} = input;
$ const config = site.getAsObject("p1events");
$ const nxConfig = site.get("nativeX");
$ const mindfulConfig = site.getAsObject("mindful");

<if(config.enabled && nxConfig && nxConfig.enabled && story)>
<if(config.enabled && mindfulConfig && mindfulConfig.adsEnabled && story)>
$ const { advertiser } = story;
$ const entity = {
id: story.id,
ns: `mindful.${mindfulConfig.namespace}.advertising-post`,
name: story.title,
props: { type: "advertising-post", published: get(story, "publishedAt") },
...(advertiser && advertiser.id && {
refs: {
advertiser: {
id: advertiser.id,
ns: `mindful.${mindfulConfig.namespace}.advertising-company`,
name: advertiser.name
}
}
}),
}
<marko-web-browser-component
name="P1EventsTrackScrollDepth"
props={
entity,
category: 'Content',
selector,
targetScrollDepths,
}
/>
</if>
<else-if(config.enabled && nxConfig && nxConfig.enabled && story)>
$ const { advertiser } = story;
$ const entity = {
id: story.id,
Expand All @@ -29,4 +57,4 @@ $ const nxConfig = site.get("nativeX");
targetScrollDepths,
}
/>
</if>
</else-if>

0 comments on commit 68a5f4c

Please sign in to comment.