@ax2/gpt-ads-module
Advanced tools
+10
-0
@@ -5,2 +5,12 @@ # Change Log | ||
| <a name="0.2.0"></a> | ||
| # [0.2.0](https://github.com/ax2inc/gpt-ads-module/compare/v0.1.1...v0.2.0) (2018-09-27) | ||
| ### Features | ||
| * Add individualRefresh option ([d6d5280](https://github.com/ax2inc/gpt-ads-module/commit/d6d5280)) | ||
| <a name="0.1.1"></a> | ||
@@ -7,0 +17,0 @@ ## [0.1.1](https://github.com/ax2inc/gpt-ads-module/compare/v0.1.0...v0.1.1) (2018-09-26) |
+1
-0
@@ -5,2 +5,3 @@ export const DEFAULT_OPTIONS = { | ||
| componentName: 'GptAd', | ||
| individualRefresh: false, | ||
| }; | ||
@@ -7,0 +8,0 @@ |
@@ -109,2 +109,5 @@ export default { | ||
| googletag.display(divId); | ||
| if (this.$gptAds.individualRefresh) { | ||
| googletag.pubads().refresh([adSlot]); | ||
| } | ||
| }); | ||
@@ -111,0 +114,0 @@ }, |
@@ -9,2 +9,3 @@ import Vue from 'vue'; | ||
| const debug = <%= options.debug || false %>; | ||
| const individualRefresh = <%= options.individualRefresh || false %>; | ||
| const networkCode = '<%= options.networkCode %>'; | ||
@@ -17,2 +18,3 @@ const GPT_LIB_SCRIPT_ID = '<%= options.GPT_LIB_SCRIPT_ID %>'; | ||
| networkCode, | ||
| individualRefresh, | ||
| slots: [], | ||
@@ -43,5 +45,7 @@ }; | ||
| } | ||
| const gptDisableInitialLoad = individualRefresh ? 'googletag.pubads().disableInitialLoad();' : ''; | ||
| gptInitScriptHtml += ` | ||
| googletag.cmd.push(function(){ | ||
| googletag.pubads().enableSingleRequest(); | ||
| ${gptDisableInitialLoad} | ||
| googletag.enableServices(); | ||
@@ -48,0 +52,0 @@ }); |
+1
-1
| { | ||
| "name": "@ax2/gpt-ads-module", | ||
| "version": "0.1.1", | ||
| "version": "0.2.0", | ||
| "description": "Google Publisher Tag ads integration for Nuxt", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+7
-0
@@ -72,2 +72,9 @@ # gpt-ads-module | ||
| ### individualRefresh | ||
| - **Type**: `Boolean` | ||
| - **Default**: `false` | ||
| If enabled, ads won't be fetched on page load but will be refreshed individually as they are mounted. | ||
| ## Usage | ||
@@ -74,0 +81,0 @@ |
12912
6.19%215
3.86%154
4.76%