Skip to content

Commit

Permalink
Fix cookieless tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Jan 19, 2024
1 parent 8ad2266 commit ce92ea7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
7 changes: 2 additions & 5 deletions app/views/layouts/_cookies_banner.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@
<div class="col-lg-8 col-md-7">
<%= render partial: 'general/cookies_info' %>
<p>
You can modify your cookie preferences at any time <%= link_to 'here', cookies_consent_path %>,
or from the link in the footer.
You can manage your preferences or withdraw your consent at any time by visiting our <%= link_to 'Cookie Policy page', cookies_consent_path %>.
</p>
</div>

<div class="col-lg-4 col-md-5 text-right">
<%= link_to t('cookies.buttons.necessary'), cookies_consent_path(allow: 'necessary'),
method: :post, class: 'btn btn-default' %>
<%= link_to t('cookies.buttons.embedding'), cookies_consent_path(allow: 'necessary,embedding'),
method: :post, class: 'btn btn-default' %>
<%= link_to t('cookies.buttons.all'), cookies_consent_path(allow: CookieConsent::OPTIONS.join(',')),
method: :post, class: 'btn btn-primary' if (Seek::Config.google_analytics_enabled || Seek::Config.piwik_analytics_enabled) %>
</div>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/layouts/_matomo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['disableCookies']);
_paq.push(['enableLinkTracking']);
_paq.push(['trackPageView']);
(function() {
var u=(("https:" == document.location.protocol) ? "https://<%= Seek::Config.piwik_analytics_url %>/" : "http://<%= Seek::Config.piwik_analytics_url %>/");
_paq.push(['setTrackerUrl', u+'matomo.php']);
Expand Down
9 changes: 4 additions & 5 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,8 @@ you can choose to have a %{project} linked to a site managed %{programme} instea
file_template: "A File Template describes conforming DataFiles.For example, a File Template that is a Word document may describe conformant PNG images."

cookies:
notice: "%{instance_name} makes use of some necessary cookies to provide its core functionality."
analytics: Additionally, we make use of %{analytics} to discover how people are using %{instance_name} in order to help us improve the service.
To opt out of this, choose the "Allow only necessary cookies" or "Allow necessary cookies and embedded content" option.
notice: "%{instance_name} uses essential cookies to ensure its proper functionality."
analytics: We also use %{analytics}, a GDPR-compliant analytics tool, to collect anonymous information about your visit. These cookies do not require your consent and are automatically enabled. If you wish to allow additional cookies for better experience, please click "Accept All Cookies."
necessary_cookies_btn: Only allow necessary cookies
all_cookies_btn: Allow all cookies
no_consent: No cookie consent provided
Expand All @@ -326,6 +325,6 @@ you can choose to have a %{project} linked to a site managed %{programme} instea
necessary: Cookies necessary for %{instance_name} to function, for example to provide user-authentication and forgery protection.
buttons:
revoke: Revoke cookie consent
all: Allow all cookies
all: Accept all cookies
embedding: Allow necessary cookies and embedded content
necessary: Allow only necessary cookies
necessary: Save preferences

0 comments on commit ce92ea7

Please sign in to comment.