dfp-js-head-bottom.html.twig in Doubleclick for Publishers (DFP) 8
Default theme implementation to display a DFP short tag.
Available variables:
- async_rendering
- single_request
- collapse_empty_divs
- disable_init_load
- targeting
See also
dfp_page_attachments()
1 theme call to dfp-js-head-bottom.html.twig
- DfpHtmlResponseAttachmentsProcessor::getHeadBottom in src/
DfpHtmlResponseAttachmentsProcessor.php - Gets the javascript to add after the slot definitions.
File
templates/dfp-js-head-bottom.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation to display a DFP short tag.
- *
- * Available variables:
- * - async_rendering
- * - single_request
- * - collapse_empty_divs
- * - disable_init_load
- * - targeting
- *
- * @see dfp_page_attachments()
- *
- * @ingroup themeable
- */
- #}
- <script type="text/javascript">
- googletag.cmd.push(function() {
- {% if async_rendering %}
- googletag.pubads().enableAsyncRendering();
- {% else %}
- googletag.pubads().enableSyncRendering();
- {% endif %}
- {% if single_request %}
- googletag.pubads().enableSingleRequest();
- {% endif %}
- {% if collapse_empty_divs == 1 %}
- googletag.pubads().collapseEmptyDivs();
- {% elseif collapse_empty_divs == 2 %}
- googletag.pubads().collapseEmptyDivs(true);
- {% endif %}
- {% if disable_init_load %}
- googletag.pubads().disableInitialLoad();
- {% endif %}
- {% for target in targeting %}
- googletag.pubads().setTargeting('{{ target.target }}', [
- {%- for value in target.value -%}
- '{{ value }}'{%- if not loop.last -%},{%- endif -%}
- {%- endfor -%}
- ]);
- {% endfor %}
- });
- googletag.enableServices();
- </script>