@playpilot/tpi 8.9.0 → 8.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.9.0",
3
+ "version": "8.9.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -86,6 +86,7 @@ export const MetaEvent = {
86
86
  ParticipantView: 'ParticipantView',
87
87
  SearchQuery: 'SearchQuery',
88
88
  GenreInterest: 'GenreInterest',
89
+ TitleInterest: 'TitleInterest',
89
90
  } as const
90
91
 
91
92
  export const MetaSource = {
@@ -36,7 +36,8 @@
36
36
  try {
37
37
  return (await fetchTitles(params))?.results
38
38
  } catch (error: any) {
39
- track(TrackingEvent.ExploreHomeRailError, null, { message: error.message, params })
39
+ console.log(error)
40
+ track(TrackingEvent.ExploreHomeRailError, null, { message: error.message || error.status.toString() || '', params })
40
41
  throw new Error(error)
41
42
  }
42
43
  }
@@ -79,7 +79,8 @@
79
79
 
80
80
  return response
81
81
  } catch (error: any) {
82
- track(TrackingEvent.ExploreResultsError, null, { message: error.message, params })
82
+ console.log(error.status)
83
+ track(TrackingEvent.ExploreResultsError, null, { message: error.message || error.status.toString() || '', params })
83
84
  throw new Error(error)
84
85
  }
85
86
  }
@@ -1,10 +1,12 @@
1
1
  <script lang="ts">
2
- import { TrackingEvent } from '$lib/enums/TrackingEvent'
2
+ import { MetaEvent, MetaSource, TrackingEvent } from '$lib/enums/TrackingEvent'
3
3
  import { track } from '$lib/tracking'
4
4
  import type { TitleData } from '$lib/types/title'
5
5
  import { getFirstAdOfType } from '$lib/api/ads'
6
6
  import { exploreParentSelector } from '$lib/explore'
7
7
  import { onMount } from 'svelte'
8
+ import { isPixelAllowed } from '$lib/pixel'
9
+ import { trackViaPixel } from '@playpilot/retargeting-tracking'
8
10
  import Modal from './Modal.svelte'
9
11
  import Title from '../Title.svelte'
10
12
  import TopScroll from '../Ads/TopScroll.svelte'
@@ -27,6 +29,8 @@
27
29
 
28
30
  track(TrackingEvent.TitleModalView, title)
29
31
 
32
+ if (isPixelAllowed()) trackViaPixel(MetaEvent.TitleInterest, { title: title.title, source: MetaSource.Link })
33
+
30
34
  onMount(() => {
31
35
  const openTimestamp = Date.now()
32
36
 
@@ -1,9 +1,11 @@
1
1
  <script lang="ts">
2
- import { TrackingEvent } from '$lib/enums/TrackingEvent'
2
+ import { MetaEvent, MetaSource, TrackingEvent } from '$lib/enums/TrackingEvent'
3
3
  import { track } from '$lib/tracking'
4
4
  import { getFirstAdOfType } from '$lib/api/ads'
5
5
  import type { TitleData } from '$lib/types/title'
6
6
  import { onMount } from 'svelte'
7
+ import { isPixelAllowed } from '$lib/pixel'
8
+ import { trackViaPixel } from '@playpilot/retargeting-tracking'
7
9
  import Popover from './Popover.svelte'
8
10
  import Title from './Title.svelte'
9
11
  import TopScroll from './Ads/TopScroll.svelte'
@@ -23,6 +25,8 @@
23
25
 
24
26
  track(TrackingEvent.TitlePopoverView, title)
25
27
 
28
+ if (isPixelAllowed()) trackViaPixel(MetaEvent.TitleInterest, { title: title.title, source: MetaSource.Link })
29
+
26
30
  onMount(() => {
27
31
  setOffset()
28
32
 
@@ -43,9 +43,11 @@
43
43
  return () => observer.disconnect()
44
44
  })
45
45
 
46
- function trackPixelsForTitle({ sid, genres, participants, providers }: TitleData): void {
46
+ function trackPixelsForTitle({ sid, genres, participants, providers, title }: TitleData): void {
47
47
  previouslyTrackingTitles.push(sid)
48
48
 
49
+ trackViaPixel(MetaEvent.TitleInterest, { title, source: MetaSource.Link })
50
+
49
51
  genres.slice(0, 3).forEach(genre => {
50
52
  trackViaPixel(MetaEvent.GenreInterest, { genre: genreData.find(g => g.slug === genre)?.name, source: MetaSource.Link })
51
53
  })