Skip to content

Commit

Permalink
add empty event
Browse files Browse the repository at this point in the history
  • Loading branch information
nechehin committed Dec 27, 2017
1 parent 9e57dff commit d1a03c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ catfish
Available events for listen:
- rendered (catfish.EVENTS.RENDERED) - fire after ads was rendered
- closed (catfish.EVENTS.CLOSED) - fire after ads was closed
- empty (catfish.EVENTS.EMPTY) - fire if ads empty

```js
catfish
Expand Down
6 changes: 4 additions & 2 deletions googletag-catfish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Google-tag catfish
*
* @version 0.0.10
* @version 0.0.11
* @param {Object} gt GoogleTag object instance
* @return {Object}
*/
Expand Down Expand Up @@ -38,7 +38,8 @@ function googletagCatfish(gt) {

var EVENTS = {
RENDERED: 'rendered',
CLOSED: 'closed'
CLOSED: 'closed',
EMPTY: 'empty'
};

var CLOSE_BUTTON_OPTIONS = {};
Expand Down Expand Up @@ -283,6 +284,7 @@ function googletagCatfish(gt) {

if (event.isEmpty) {
log('Empty ads response from slot ' + event.slot.getAdUnitPath());
fireEvent(EVENTS.EMPTY);
return;
}

Expand Down
17 changes: 9 additions & 8 deletions googletag-catfish.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1a03c8

Please sign in to comment.