Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

@shopify/react-tracking-pixel

3.0.33 • Public • Published

@shopify/react-tracking-pixel

Build Status License: MIT npm version npm bundle size (minified + gzip)

Allows React apps to easily embed tracking pixel iframes

Installation

$ yarn add @shopify/react-tracking-pixel

Usage

This library exports a <TrackingPixel /> component, which allows React apps to easily embed tracking pixel iframes.

Basic Example

import TrackingPixel from 'react-tracking-pixel';
 
// ...
 
const myurl = 'myurl';
 
<TrackingPixel url={myurl} />;

With Proconnected Hosts

import TrackingPixel from 'react-tracking-pixel';
 
// ...
 
const myurl = 'myurl';
const myhosts = ['example.com', 'moreexamples.com'];
 
<TrackingPixel url={myurl} preconnectHosts={myhosts} />;

Interface

export interface Props {
  url: string;
 
  /**
   * Additional hosts to preconnect to. These should be hosts that
   * are connected to by the page that will be loaded in an iframe.
   */
  preconnectHosts?: string[];
}

Keywords

none

Install

npm i @shopify/[email protected]

Version

3.0.33

License

MIT

Unpacked Size

5.31 kB

Total Files

9

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar