TrackingPixel
@shopify/shop-minis-platform-sdk / components/TrackingPixel/TrackingPixel
TrackingPixelProps\<T>
Type Parameters
Type Parameter |
---|
T |
Properties
children
children:
Element
The child content to be tracked. Can only be a single element in order to properly track the visibility of the content on the native side.
eventData?
optional
eventData:T
Data object that will be passed to the onImpression callback.
id
id:
string
id
A unique ID for the pixel, must be unique within a given TrackingProvider
minimumViewTime?
optional
minimumViewTime:number
A number representing the minimum amount of time in milliseconds that the child content must be visible before an impression is fired.
Default
0
threshold?
optional
threshold:number
|PixelPositionTrigger
A number between 0 and 1 representing the percentage of child content that must be visible before an impression is fired, or a PixelPositionTrigger.
Default
'half-visible'
Methods
onImpression()
onImpression(
eventData
?):void
Callback that will be invoked when the pixel becomes visible.
Parameters
Parameter | Type |
---|---|
eventData ? | T |
Returns
void
void
PixelPositionTrigger
PixelPositionTrigger:
"any-visible"
|"half-visible"
|"fully-visible"
VISIBLE_THRESHOLD
const
VISIBLE_THRESHOLD:{ [key in PixelPositionTrigger]: number }
TrackingPixel()
TrackingPixel\<
T
>(__namedParameters
):Element
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
__namedParameters | TrackingPixelProps \<T > |
Returns
Element