Skip to content

Commit

Permalink
Merge pull request #115 from chriskyfung/fixes/correct-consent-purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskyfung authored Feb 1, 2025
2 parents aa767ed + 582dd6a commit 61b45d5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _includes/blocks/ad-before-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
data-block-on-consent-purposes="advertising"
data-npa-on-unknown-consent="true"
{% when "iubenda" -%}
data-block-on-consent-purposes="1,3,4"
data-block-on-consent-purposes="1,4,5"
{% endcase -%}
type="adsense"
data-ad-client="{{ site.adsense.client_id }}"
Expand Down
4 changes: 2 additions & 2 deletions _includes/blocks/disqus.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<amp-iframe width=600 height={{ site.amp_disqus.height | default: 140 }} layout="responsive"
{%- case consent_type %}
{% when "built-in" -%}
data-block-on-consent-purposes="functional"
data-block-on-consent-purposes="functional,analytics,advertising"
{% when "iubenda" -%}
data-block-on-consent-purposes="1,3"
data-block-on-consent-purposes="1,3,4,5"
{% endcase -%}
sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable
src="{{ site.amp_disqus.url }}?url={{ page.url | absolute_url }}&title='{{ page.title | url_encode }}'">
Expand Down
2 changes: 1 addition & 1 deletion _includes/sidebar/custom/ad-sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h3><span>Ads</span></h3>
data-block-on-consent-purposes="advertising"
data-npa-on-unknown-consent="true"
{% when "iubenda" -%}
data-block-on-consent-purposes="1,3,4"
data-block-on-consent-purposes="1,4,5"
{% endcase -%}
type="adsense"
data-ad-client="{{ site.adsense.client_id }}"
Expand Down
19 changes: 17 additions & 2 deletions _includes/youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,23 @@

{%- assign data_vars = ' data-vars-video-title="' | append: video_label | append: '"' -%}
{%- assign data_vars = data_vars | append: ' data-vars-video-url="' | append: video_url | append: '"' -%}

{{ include.indent }}<amp-youtube id="yt-{{- include.id -}}" width="480" height="270" layout="responsive" credentials="omit" data-videoid="{{- include.id -}}"{{ attrs_for_playlist }}{{ attr_title }}{{ data_vars }} data-param-rel="0">

{%- if site.consent == true -%}
{%- if site.iubenda.remote_consent_url -%}
{%- assign consent_type = "iubenda" -%}
{%- else -%}
{%- assign consent_type = "built-in" -%}
{%- endif -%}
{%- endif -%}

{{ include.indent }}<amp-youtube id="yt-{{- include.id -}}" width="480" height="270" layout="responsive"
{% case consent_type -%}
{% when "built-in" -%}
data-block-on-consent-purposes="functional"
{% when "iubenda" -%}
data-block-on-consent-purposes="1,3"
{% endcase -%}
credentials="omit" data-videoid="{{- include.id -}}"{{ attrs_for_playlist }}{{ attr_title }}{{ data_vars }} data-param-rel="0">
<div fallback>
<p>This browser does not support the YouTube video player. <a href="{{- video_url -}}" rel="noopener" target="_blank">Watch on YouTube</a></p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
data-block-on-consent-purposes="advertising"
data-npa-on-unknown-consent="true"
{% when "iubenda" -%}
data-block-on-consent-purposes="1,3,4"
data-block-on-consent-purposes="1,4,5"
{% endcase -%}
{%- if jekyll.environment != 'production' -%}
data-adtest="on"
Expand Down

0 comments on commit 61b45d5

Please sign in to comment.