5.5.0 • Published 3 months ago

@revjet/react-revjet-tag v5.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

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>
	)
}
5.4.2

5 months ago

5.5.0

3 months ago

5.4.1

6 months ago

5.4.0

6 months ago

5.3.0

7 months ago

5.2.3

9 months ago

5.2.2

2 years ago

5.2.1

2 years ago

5.1.0

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago