@ax2/gpt-ads-module
Advanced tools
+15
-0
@@ -5,2 +5,17 @@ # Change Log | ||
| <a name="0.4.0"></a> | ||
| # [0.4.0](https://github.com/ax2inc/gpt-ads-module/compare/v0.3.0...v0.4.0) (2018-10-04) | ||
| ### Bug Fixes | ||
| * Prevent TypeError if mapping were to be undefined ([a8f4e53](https://github.com/ax2inc/gpt-ads-module/commit/a8f4e53)) | ||
| ### Features | ||
| * Add collapseEmptyDivs option & collapseEmptyDiv prop ([eaf8ee2](https://github.com/ax2inc/gpt-ads-module/commit/eaf8ee2)) | ||
| <a name="0.3.0"></a> | ||
@@ -7,0 +22,0 @@ # [0.3.0](https://github.com/ax2inc/gpt-ads-module/compare/v0.2.0...v0.3.0) (2018-10-04) |
+1
-0
@@ -7,2 +7,3 @@ export const DEFAULT_OPTIONS = { | ||
| responsive: false, | ||
| collapseEmptyDivs: false, | ||
| }; | ||
@@ -9,0 +10,0 @@ |
@@ -38,2 +38,7 @@ export default { | ||
| }, | ||
| collapseEmptyDiv: { | ||
| type: Boolean, | ||
| required: false, | ||
| default: null, | ||
| }, | ||
| }, | ||
@@ -121,3 +126,3 @@ computed: { | ||
| getCurrentSizeMappingIndex () { | ||
| const { mapping } = this; | ||
| const mapping = this.mapping || []; | ||
| let index = null; | ||
@@ -146,2 +151,3 @@ mapping.some((size, i) => { | ||
| isResponsive, | ||
| collapseEmptyDiv, | ||
| } = this; | ||
@@ -155,2 +161,7 @@ | ||
| // Collapse empty div slot-level override | ||
| if (collapseEmptyDiv !== null) { | ||
| adSlot.setCollapseEmptyDiv(collapseEmptyDiv); | ||
| } | ||
| // Build size mapping if any | ||
@@ -157,0 +168,0 @@ if (sizeMapping.length > 0) { |
@@ -10,2 +10,3 @@ import Vue from 'vue'; | ||
| const individualRefresh = <%= options.individualRefresh || false %>; | ||
| const collapseEmptyDivs = <%= options.collapseEmptyDivs || false %>; | ||
| const networkCode = '<%= options.networkCode %>'; | ||
@@ -44,3 +45,7 @@ const GPT_LIB_SCRIPT_ID = '<%= options.GPT_LIB_SCRIPT_ID %>'; | ||
| } | ||
| // Disable initial load | ||
| const gptDisableInitialLoad = individualRefresh ? 'googletag.pubads().disableInitialLoad();' : ''; | ||
| // Collapse empty div | ||
| const gptCollapseEmptyDivs = collapseEmptyDivs ? 'googletag.pubads().collapseEmptyDivs();' : ''; | ||
| gptInitScriptHtml += ` | ||
@@ -50,2 +55,3 @@ googletag.cmd.push(function(){ | ||
| ${gptDisableInitialLoad} | ||
| ${gptCollapseEmptyDivs} | ||
| googletag.enableServices(); | ||
@@ -52,0 +58,0 @@ }); |
+1
-1
| { | ||
| "name": "@ax2/gpt-ads-module", | ||
| "version": "0.3.0", | ||
| "version": "0.4.0", | ||
| "description": "Google Publisher Tag ads integration for Nuxt", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+14
-0
@@ -86,2 +86,9 @@ # gpt-ads-module | ||
| ### collapseEmptyDivs | ||
| - **Type**: `Boolean` | ||
| - **Default**: `false` | ||
| Set to true to have empty ad slots collapsed themselves, this can be overridden at slot-level with `collapseEmptyDiv` prop. | ||
| ## Usage | ||
@@ -131,2 +138,9 @@ | ||
| #### collapseEmptyDiv | ||
| - Type: `Boolean` | ||
| - Default: `null` | ||
| Override `collapseEmptyDivs` option at the slot's level. | ||
| ### Examples | ||
@@ -133,0 +147,0 @@ |
17171
7.93%298
5.67%190
7.95%