Angular GPT
A Angular implementation of the google GPT API.
Installation:
To install just run the following command (no other dependencies are required):
npm install --save ng-gpt
or
yarn add ng-gpt
Implementation
import { GptModule } from 'ng-gpt';
...
@NgModule({
declarations: [AppComponent],
imports: [
GptModule.forRoot({
idleLoad: true,
enableVideoAds: true,
personalizedAds: false,
singleRequestMode: false,
cookies: false,
ppid: '',
centering: true,
onSameNavigation: 'refresh',
globalTargeting: {
food: ['chicken', 'meatballs'],
},
enableLazyLoad: {
fetchMarginPercent: 500,
renderMarginPercent: 200,
mobileScaling: 2.0,
},
}),
],
providers: [],
bootstrap: [AppComponent],
})
<gpt-ad
id="1625556673407-0"
adUnit="/35096353/pub-showcase"
[sizes]="[[728, 90]]"
[sizeMapping]="[
{ viewport: [1024, 768], sizes: [[728, 90],[300, 250]] },
{ viewport: [900, 768], sizes: [[300, 250],[210, 60]] }
]"
[targetingArguments]="{ categories: ['restaurantes', 'abogados'] }"
[collapseEmptyDivs]="true"
></gpt-ad>