@ta-interaktiv/react-tracking
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.3 • Public • Published

    React Tracking

    React component that grabs the current tracking data from the Newsnet API and sets up the appropriate trackers (WEMF, Google Tag Manager).

    Installation

    yarn add @ta-interaktiv/react-tracking

    Usage

    Use the Newsnet API to download the necessary data, using the article ID:

    import Tracking from '@ta-interaktiv/react-tracking'
    function YourComponent(props) {
      return (
        <div>
          <Tracking articleId='3352335' />
        </div>
      )
    }

    Add in data directly, circumventing network requests:

    // Access Newsnet API somewhere and get data
    let newsnetData = fetch('m.tenant.ch/api/articles/111111/external_services')
     
    render () {
      return (
        <Tracking articleId={111111}
                  gtmId={newsnetData.configs.gtm_id}
                  statisticsConfig={newsnetData.statistics}
        />
      )
    }

    Documentation

    Can be found here.

    Install

    npm i @ta-interaktiv/react-tracking

    DownloadsWeekly Downloads

    56

    Version

    3.0.3

    License

    ISC

    Unpacked Size

    61.2 kB

    Total Files

    11

    Last publish

    Collaborators

    • grmnd
    • sebaa
    • mathiaslutz
    • bartfehr