https://github.com/shukerullah/react-native-google-publisher-tag
A react-native component for Google Publisher Tags using WebView
https://github.com/shukerullah/react-native-google-publisher-tag
doubleclick-banner doubleclick-for-publishers google-ads react-native
Last synced: 7 months ago
JSON representation
A react-native component for Google Publisher Tags using WebView
- Host: GitHub
- URL: https://github.com/shukerullah/react-native-google-publisher-tag
- Owner: shukerullah
- License: mit
- Created: 2020-08-12T17:01:07.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-31T12:07:25.000Z (about 5 years ago)
- Last Synced: 2025-02-19T18:18:47.976Z (8 months ago)
- Topics: doubleclick-banner, doubleclick-for-publishers, google-ads, react-native
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-google-publisher-tag
## Installtion
```shell
$ yarn add react-native-google-publisher-tag
```or
```shell
$ npm install --save react-native-google-publisher-tag
```_Note: You need to install [react-native-webview](https://github.com/react-native-community/react-native-webview)_ before using `react-native-google-publisher-tag`
## Example
```javascript
import GooglePublisherTag from 'react-native-google-publisher-tag';{
// TODO: Do something on load
}}
onPress={(url) => {
// Note: This will override Linking.openURL
// Linking.openURL(url);
// OR
// InAppBrowser.open(url)
}}
/>```
## Props
### adUnitId
Sets the AdUnit ID for all future ad requests.
| TYPE | REQUIRED |
| ------------- | ------------- |
| string | Yes |### adUnitSize
Every ad slot you define must specify the ad size(s) eligible to serve in that slot. The way ad sizes are specified varies depending on the type of ads to be displayed, as well as the size and flexibility of the ad slots themselves. _Corresponding to [GPT Ad sizes](https://developers.google.com/doubleclick-gpt/guides/ad-sizes)_.
| TYPE | REQUIRED |
| ------------- | ------------- |
| string | Yes |### adUnitTargeting
Ad unit targeting can be used to target ads more granularly than ad units. _Corresponding to [GPT Key-value targeting](https://developers.google.com/doubleclick-gpt/guides/key-value-targeting)_.
| TYPE | REQUIRED |
| ------------- | ------------- |
| string | No |### baseUrl
| TYPE | REQUIRED |
| ------ | -------- |
| string | Yes |### width
Width is not required but recommended for fluid and it effect only fluid size. By default its "100%".
| TYPE | REQUIRED |
| ------ | -------- |
| number | No |### backgroundColor
| TYPE | REQUIRED |
| ------ | -------- |
| string | No |### onPress
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### impressionViewable
_Reference: [googletag.events.ImpressionViewableEvent](https://developers.google.com/doubleclick-gpt/reference#googletag.events.impressionviewableevent)_.
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### slotOnload
_Reference: [googletag.events.SlotOnloadEvent](https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotonloadevent)_.
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### slotRenderEnded
_Reference: [googletag.events.SlotRenderEndedEvent](https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotrenderendedevent)_.
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### slotRequested
_Reference: [googletag.events.SlotRequestedEvent](https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotrequestedevent)_.
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### slotResponseReceived
_Reference: [googletag.events.SlotResponseReceived](https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotresponsereceived)_.
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### slotVisibilityChanged
_Reference: [googletag.events.SlotVisibilityChangedEvent](https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotvisibilitychangedevent)_.
| TYPE | REQUIRED |
| -------- | -------- |
| Function | No |### Follow me on Twitter: [@shukerullah](https://twitter.com/shukerullah)