Socket
Socket
Sign inDemoInstall

ng-gpt

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-gpt

A Angular implementation of the google GPT API.


Version published
Weekly downloads
27
increased by237.5%
Maintainers
1
Weekly downloads
 
Created
Source

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

// app.module.ts
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>

Parameters

  • adUnit [string] - required Full ad unit path with the network code and unit code.
  • id [string] - ID of the div that will contain this ad unit.
  • size [[number, number][] | string] - Width and height of the added slot. This is the size that is used in the ad request if no responsive size mapping is provided or the size of the viewport is smaller than the smallest size provided in the mapping. Default fluid.
  • sizeMapping [{viewport: [number, number]; sizes: [number, number][]}[]] - Array of size mappings. Each size mapping is an array of two elements.
  • forceSafeFrame [boolean] - true to force all ads in this slot to be rendered in SafeFrames and false to opt-out of a page-level setting (if present). Setting this to false when not specified at page-level, won't change anything.
  • safeFrameConfig [string] - slot-level preferences for SafeFrame configuration. Any unrecognized keys in the config object will be ignored. The entire config will be ignored if an invalid value is passed for a recognized key.
  • refresh [number] - refresh interval.
  • collapseEmptyDivs [boolean] - Sets whether the slot div should be hidden when there is no ad in the slot.
  • targetingArguments [[key: string]: any] - custom targeting parameters for a given key that apply to all pubads service ad slots.

Keywords

FAQs

Package last updated on 22 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc