1.0.0 • Published 7 years ago

ta-react-polymorphic-tracking v1.0.0

Weekly downloads
2
License
ISC
Repository
gitlab
Last release
7 years ago

Polymorphic Tracking

Component to track visits to a website, accessing the Newsnet API for all tracking information. Currently supports GTM, WEMF and Webseismo. Additional Providers need to be added separately.

Version: 1.0

module.exports ⇐ React.PureComponent

Kind: Exported class
Extends: React.PureComponent

new module.exports()

ParamTypeDescription
props.articleIdstringThe article ID of the link article in the CD. If not available will assume that content is being loaded in an iframe.

module.exports.componentDidMount()

Called after component has been mounted. This should only be called once within the component lifecycle, even with state and props changing.

Kind: instance method of module.exports(#exp_module_Polymorphic Tracking--module.exports)

module.exports.trackWithImage(src)

Track a visit using an image.

Kind: static method of module.exports(#exp_module_Polymorphic Tracking--module.exports)

ParamTypeDescription
srcstringThe URL of the tracking pixel to use as the image source.

Installation

yarn add ta-react-componentname

Usage

import Component from 'ta-react-componentname';

// more code...

class YourComponent extends React.Component {
  render() {

    return (
      <Component propName="example" />
    )
  }
}