@revjet/react-revjet-tag
TypeScript icon, indicating that this package has built-in type declarations

5.5.0 • Public • Published

React RevJet Tag

RevJet content Tag for React.

Usage Example

import React from 'react'
import { isViewableEvent, RevJetTag, TrackingEvent } from '@revjet/react-revjet-tag'

export interface AppProps {}

const tagProperties: TagProperties = {
	_tag: 'tagXXXX',
	_plc_id: '12345',
	_key: 'xxx',
	debug: 'emulate',
	_opts: {
		custom_domain: 'ads.revjet.com',
		autohide: false,
		responsive: true,
		responsive_height: 'dynamic',
		delivery_method: 'banner',
		_imp_banner_size: '640x480'
	},
	_custom_parameter: 'Custom Parameter'
}

export function App(_props: AppProps) {
	// Optional
	const onBeforeLoad = useCallback(() => {
		console.log('onBeforeLoad')
	}, [])

	// Optional
	const onLoad = useCallback(() => {
		console.log('onLoad')
	}, [])

	// Optional
	const onError = useCallback(
		(err) => {
			console.log('onError', err)
		},
		[]
	)

	// Optional
	const onTrackingEvent = useCallback((type: string, event: TrackingEvent) => {
		const properties = event.getProperties ? event.getProperties() : { type: type }
		if (isViewableEvent(event)) {
			console.log('Received viewable tracking event:', properties)
		} else {
			console.log('Received tracking event:', properties)
		}
	}, [])

	return (
		<div>
			<RevJetTag
				tagProperties={tagProperties}
				onBeforeLoad={onBeforeLoad}
				onLoad={onLoad}
				onError={onError}
				onTrackingEvent={onTrackingEvent}
			/>
		</div>
	)
}

Readme

Keywords

none

Package Sidebar

Install

npm i @revjet/react-revjet-tag

Weekly Downloads

2

Version

5.5.0

License

MIT

Unpacked Size

139 kB

Total Files

98

Last publish

Collaborators

  • albburtsev
  • vladislavtomenko
  • dmitry.banasko
  • vmarteev
  • mortiy