Programmatic Access Library (PAL)
The Programmatic Access Library (PAL) is a lightweight SDK that provide discrete access to targeting signals for Google Ad Manager programmatic ads.
Configuration
Attribute | Type | Required | Description |
---|---|---|---|
enabled | boolean | Yes | Enable the plugin (Defaults to false if no value is given.) |
allowStorageConsent | boolean | No | Whether PAL has purpose 1 consent to use identifiers and storage. The value needs to be determined by integrating with CMP (Consent Management Provider). This is set to false by default. If specified as true, PAL has consent from the user to use information like cookies, device IDs and advertising IDs. This value needs to be set to be IAB TCFv2 (Transparency and Consent Framework) compliant. (Defaults to false) |
ppid | string | No | The publisher provided identifier. (Defaults to empty string) |
descriptionUrl | string | No | The description URL of the content during which the ad will be played. (Defaults to the url that the video is playing) |
Initialize the PAL Plugin
To initialize the PAL Plugin, add pal attribute to the plugins object in your config. To see more details about configuration, please check out PAL Plugin
import React, { useRef, useEffect, useState } from "react";
import { SafeAreaView, StyleSheet, View } from "react-native";
import { LuraPlayer, type UnifiedPlayer, type Configuration } from "@akta-tech/lura-player-react-native";
import { LuraPlayerControls } from "@akta-tech/lura-player-react-native-ui";
export default function App() {
const playerRef = useRef<UnifiedPlayer>(null);
const config: Configuration = {
...
plugins: {
pal: {
enabled: true,
allowStorageConsent: true,
ppid: "12DJD92J02KXVLS9D817DCJ078S8F1J2",
descriptionUrl: "https://docs4.lura.app/",
},
},
...
};
useEffect(() => {
playerRef.current?.setConfig(config)
}, [playerRef]);
return (
<View>
<SafeAreaView />
<LuraPlayer ref={playerRef} style={styles.player}>
<LuraPlayerControls></LuraPlayerControls>
</LuraPlayer>
</View>
);
}
const styles = StyleSheet.create({
player: {
backgroundColor: "#000",
width: "100%",
maxWidth: 640,
aspectRatio: 16 / 9,
},
});
Using the PAL Nonce
LuraPlayer automatically fills the reserved macro LURA_PAL_NONCE
in
URL's under the ads parameter. Check out macros for more details.