ta-react-webseismotracker

2.0.1 • Public • Published

Webseismo-Tracker Component

npm version

Installation

yarn add ta-react-webseismotracker

Usage

import WebseismoTracker from 'ta-react-webseismotracker';
 
// ...
 
class YourComponent extends React.Component {
 
  componentDidMount() {
    // Get the Webseismo statistics object from Newsnet API here
    // NOT ACTUAL IMPLEMENTATION!
    this.setState({
      webseismoTrackingObject: data.statistics.webseismo
    })
  }
 
  render() {
    return <WebseismoTracker {this.state.webseismoTrackingObject}/>
  }
}

API

WebseismoTracker

Tracker component to render an invisible pixel image that tracks the hits on the page on the Webseismo screen.

Meta

  • version: 2.0

webseismoTracker

Activates a call to a tracking pixel; based on the current content width it will call a different URL.

Parameters

  • props object
    • props.url_webapp string Basic tracking URL, used for mobile devices.
    • props.url_tablet string Tracking URL for tablet-sized devices.
    • props.url_desktop string Tracking URL for desktop-sized devices.

Returns XML A TrackingPixel react element.

Contributing

Development

Code resides in /src. Test cases are provided using Storybook. Add test cases in /stories/index.js, and run them with

yarn run storybook

They will appear on http://localhost:9001.

This repository follows the Standard JS style. To fix your code, run

yarn run fix

JavaScript Style Guide

Building & Releasing

Babel is used to provide ES5 compatible code. To compile run

yarn run dist

Changes should go into the changelog. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Update the Readme with the current API using

yarn run docs

Package Sidebar

Install

npm i ta-react-webseismotracker

Weekly Downloads

0

Version

2.0.1

License

ISC

Last publish

Collaborators

  • xeophin