14.0.0 • Published 21 days ago

ng2-adsense v14.0.0

Weekly downloads
664
License
MIT
Repository
github
Last release
21 days ago

ng2-adsense NPM versioncoverage status

Easy AdSense for Angular Applications

Demo: https://ng2-adsense.xmplaylist.com/

Install

npm install ng2-adsense

Dependencies

Latest version available for each version of Angular

ng2-adsenseAngular
5.4.35.x 6.x 7.x
6.0.38.x
8.0.19.x
9.1.010.x 11.x
10.1.012.x 13.x
11.0.014.x
12.0.015.x
13.0.016.x
current>=17

Use

Add adsense code

Use the standard AdSense code somewhere in your <head></head> as you normally would

<script async src=//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js></script>

Import NgModule

Add AdsenseModule to the imports of your NgModule

import { AdsenseModule } from 'ng2-adsense';

@NgModule({
  imports: [
    // shown passing global defaults (optional)
    AdsenseModule.forRoot({
      adClient: 'ca-pub-7640562161899788',
      adSlot: 7259870550,
    }),
    ...

Show Ad

Uses global defaults which can be overriden via inputs

<ng-adsense></ng-adsense>

Inputs

inputtypedescription
adClientstringaccount ca-pub-XXXXXXXXXXXXXXXX
adSlotstring/numberad slot/number
adFormatstringadsense ad format
adRegionstringolder adsense code to make all ads on page the same
displaystringelement display style
fullWidthResponsivebooleanenable full width responsive ad
heightnumberelement height in px
widthnumberelement width in px
layoutstringused for in-feed ads
layoutKeystringused for in-feed ads
pageLevelAdsbooleanenable page-level ads
adteststringsets up some sort of google test ad
classNamestringadd custom class names to the "ins" element
<ng-adsense
  [adClient]="'ca-pub-7640562161899788'"
  [adSlot]="7259870550"
  [display]="'inline-block'"
  [width]="320"
  [height]="108"
></ng-adsense>
14.0.0

21 days ago

13.0.0

12 months ago

12.0.0

1 year ago

11.0.0

2 years ago

10.1.0

2 years ago

10.0.1

3 years ago

10.0.0

3 years ago

9.1.0

3 years ago

9.0.0

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.0.0

4 years ago

6.0.3

4 years ago

6.0.2

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.4.3

5 years ago

5.4.2

5 years ago

5.4.1

5 years ago

5.4.0

5 years ago

5.3.4

6 years ago

5.3.3

6 years ago

5.3.2

6 years ago

5.3.1

6 years ago

5.3.0

6 years ago

5.2.0

6 years ago

5.1.4

6 years ago

5.1.3

6 years ago

5.1.2

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.0.12

7 years ago

4.0.11

7 years ago

4.0.10

7 years ago

4.0.8

7 years ago

4.0.7

7 years ago

4.0.6

7 years ago

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.5

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

8 years ago

0.0.1

8 years ago