Skip to content

Commit

Permalink
Remove piwik
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmartt committed Jul 9, 2024
1 parent d6ced0d commit ca87213
Show file tree
Hide file tree
Showing 28 changed files with 35 additions and 79 deletions.
7 changes: 0 additions & 7 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,4 @@ module ApplicationHelper
def popover_menu(&)
render(layout: "popover", &)
end

def piwik_domain
host = URI.parse(request.original_url).host
domain = PublicSuffix.parse(host).domain.to_s
"#{Rails.configuration.pub_secrets[:piwik_host_prefix]}.#{domain}/" if domain.in?(["basicattentiontoken.org", "brave.com"])
rescue PublicSuffix::DomainNotAllowed, Piwik::MissingConfiguration
end
end
4 changes: 0 additions & 4 deletions app/javascript/analytics.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ class StatementDetails extends React.Component<IStatementProps, any> {
{!this.props.showPage && (
<div className="px-5 py-3">
<a
data-piwik-action="StatementViewMore"
data-piwik-name="Clicked"
data-piwik-value=""
href={routes.publishers.statements.show.path.replace(
"{period}",
this.props.statement.earningPeriod.startDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ class BitflyerConnection extends React.Component<any, any> {
<FlexWrapper>
<a
className="btn btn-link p-0"
data-piwik-action="BitflyerDisconnectClicked"
data-piwik-name="Clicked"
data-piwik-value="Dashboard"
rel="nofollow"
data-method="delete"
href={routes.publishers.bitflyer.destroy}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ class GeminiConnection extends React.Component<any, any> {
<FlexWrapper>
<a
className="btn btn-link p-0"
data-piwik-action="GeminiDisconnectClicked"
data-piwik-name="Clicked"
data-piwik-value="Dashboard"
rel="nofollow"
data-method="delete"
href={routes.publishers.gemini.destroy}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ class UpholdConnectButton extends React.Component<any, any> {
</Tooltip>
<a
className="btn btn-secondary font-weight-bold mb-2"
data-piwik-action="UpholdConnectClicked"
data-piwik-name="Clicked"
data-piwik-value="Dashboard"
rel="nofollow"
data-method="post"
href={routes.publishers.uphold.connect}
Expand Down Expand Up @@ -113,9 +110,6 @@ class GeminiConnectButton extends React.Component<any, any> {
</Tooltip>
<a
className="btn btn-secondary font-weight-bold mb-2"
data-piwik-action="GeminiConnectClicked"
data-piwik-name="Clicked"
data-piwik-value="Dashboard"
rel="nofollow"
data-method="post"
href={routes.publishers.gemini.connect}
Expand All @@ -135,9 +129,6 @@ class GeminiConnectButton extends React.Component<any, any> {
const BitflyerConnectButton = () => (
<a
className="btn btn-secondary font-weight-bold mb-2"
data-piwik-action="BitflyerConnectClicked"
data-piwik-name="Clicked"
data-piwik-value="Dashboard"
rel="nofollow"
data-method="post"
href={routes.publishers.bitflyer.connect}
Expand Down
12 changes: 6 additions & 6 deletions app/views/application/_choose_channel_type.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
h6= t "publishers.choose_new_channel_type.website.heading"
= t "publishers.choose_new_channel_type.website.description"

= link_to(publisher_register_youtube_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card', :"data-piwik-action" => "AddYoutubeChannelClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "AddChannelFlow") do
= link_to(publisher_register_youtube_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card') do
.card-body
.icon-and-text--icon
= image_tag "choose-channel/youtube.svg", class: "choose-channel--icon"
.icon-and-text--text
h6= t "publishers.choose_new_channel_type.youtube.heading"
= t "publishers.choose_new_channel_type.youtube.description"

= link_to(publisher_register_twitch_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card', :"data-piwik-action" => "AddTwitchChannelClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "AddChannelFlow") do
= link_to(publisher_register_twitch_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card') do
.card-body
.icon-and-text--icon
= image_tag "choose-channel/twitch.svg", class: "choose-channel--icon"
.icon-and-text--text
h6= t "publishers.choose_new_channel_type.twitch.heading"
= t "publishers.choose_new_channel_type.twitch.description"

= link_to(publisher_register_twitter_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card', :"data-piwik-action" => "AddTwitterChannelClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "AddChannelFlow") do
= link_to(publisher_register_twitter_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card') do
.card-body
.icon-and-text--icon
= image_tag "choose-channel/twitter.svg", class: "choose-channel--icon"
.icon-and-text--text
h6= t "publishers.choose_new_channel_type.twitter.heading"
= t "publishers.choose_new_channel_type.twitter.description"

= link_to(publisher_register_vimeo_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card', :"data-piwik-action" => "AddVimeoChannelClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "AddChannelFlow") do
= link_to(publisher_register_vimeo_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card') do
.new-tag
.card-body
.icon-and-text--icon
Expand All @@ -43,7 +43,7 @@
h6= t "publishers.choose_new_channel_type.vimeo.heading"
= t "publishers.choose_new_channel_type.vimeo.description"

= link_to(publisher_register_reddit_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card', :"data-piwik-action" => "AddRedditChannelClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "AddChannelFlow") do
= link_to(publisher_register_reddit_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card') do
.new-tag
.card-body
.icon-and-text--icon
Expand All @@ -52,7 +52,7 @@
h6= t "publishers.choose_new_channel_type.reddit.heading"
= t "publishers.choose_new_channel_type.reddit.description"

/ = link_to(publisher_register_github_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card', :"data-piwik-action" => "AddGithubChannelClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "AddChannelFlow") do
/ = link_to(publisher_register_github_channel_omniauth_authorize_path, method: :post, class: 'card block-link--card') do
/ .new-tag
/ .card-body
/ .icon-and-text--icon
Expand Down
6 changes: 2 additions & 4 deletions app/views/faqs/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
= link_to(\
t("shared.log_in"), \
log_in_publishers_path, \
class: "btn btn-block btn-secondary", \
:"data-piwik-action" => "FAQLoginClicked", \
:"data-piwik-name" => "Clicked", \
:"data-piwik-value" => "FAQ")
class: "btn btn-block btn-secondary"


= link_to(\
t(".title"), \
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doctype html
html
head data-piwik-host=piwik_domain
head
= csrf_meta_tags
meta http-equiv="X-UA-Compatible" content="IE=edge"
meta name="viewport" content=("width=device-width, initial-scale=#{if local_assigns[:viewport_initial_scale] then viewport_initial_scale else '0.6' end}")
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/error.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doctype html
html
head data-piwik-host=piwik_domain
head
title Brave Publishers: Error
link rel="icon" type="image/png" href=image_path("favicon.ico")
sass:
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/headless.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doctype html
html
head data-piwik-host=piwik_domain
head
title= t "shared.app_title"
= csrf_meta_tags
= stylesheet_link_tag('application', media: 'all')
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/no_js.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doctype html
html
head data-piwik-host=piwik_domain
head
= csrf_meta_tags
meta http-equiv="X-UA-Compatible" content="IE=edge"
meta name="viewport" content="width=device-width, initial-scale=1"
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/public.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doctype html
html
head data-piwik-host=piwik_domain
head
= csrf_meta_tags
meta http-equiv="X-UA-Compatible" content="IE=edge"
meta name="viewport" content=("width=device-width, initial-scale=#{if local_assigns[:viewport_initial_scale] then viewport_initial_scale else '0.6' end}")
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/static.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
doctype html

html
head data-piwik-host=piwik_domain
head
= csrf_meta_tags
meta http-equiv="X-UA-Compatible" content="IE=edge"
meta name="viewport" content="width=device-width, initial-scale=1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
= form_for @publisher, {method: :post, url: promo_registrations_path} do |f|
= f.hidden_field(:promo_token, :value => params[:promo_token])
.text-center
= f.submit(t("promo.activate.button").upcase, class: "btn promo--activate-button", :"data-piwik-action" => "ActivatePromoClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "PromoFlow")
= f.submit(t("promo.activate.button").upcase, class: "btn promo--activate-button")
2 changes: 1 addition & 1 deletion app/views/publishers/registrations/log_in.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- if @should_throttle
.form-group
= recaptcha_tags
= submit_tag(t("shared.log_in"), class: "btn btn-block btn-primary", :"data-piwik-action" => "NewAuthLoginClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "NewAuthFlow")
= submit_tag(t("shared.log_in"), class: "btn btn-block btn-primary")

.single-panel--footer.single-panel--footer--secondary
p
Expand Down
2 changes: 1 addition & 1 deletion app/views/publishers/registrations/sign_up.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
label
= check_box_tag :terms_of_service, require: true
span.pl-2= t('.terms_of_service')
= submit_tag t("shared.get_started"), class: "btn btn-block btn-primary", :"data-piwik-action" => "StartFlowClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Landing"
= submit_tag t("shared.get_started"), class: "btn btn-block btn-primary"

.single-panel--footer.single-panel--footer--secondary
' #{t("shared.existing_account")}
Expand Down
4 changes: 2 additions & 2 deletions app/views/publishers/security/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
= link_to t(".totp.confirm_disable.confirm"), "#", class: "js-confirm btn btn-wide btn-outline-secondary"

- else
p= link_to t(".totp.button"), new_totp_registration_path, class: "btn btn-block btn-primary", :"data-piwik-action" => "CreateTOTPClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "2FA"
p= link_to t(".totp.button"), new_totp_registration_path, class: "btn btn-block btn-primary"
p.icon= render "smartphone_with_code"

.col-left-aligned--content
Expand Down Expand Up @@ -96,5 +96,5 @@
== "&bull; "
= t ".u2f.disabled"
.col-left-aligned--action
p= link_to t(".u2f.button"), new_u2f_registration_path, class: "btn btn-block btn-primary", :"data-piwik-action" => "CreateU2FClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "2FA"
p= link_to t(".u2f.button"), new_u2f_registration_path, class: "btn btn-block btn-primary"
p.icon= render "usb"
5 changes: 1 addition & 4 deletions app/views/site_channels/_verification_failed_modal.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
= f.submit( \
t(".try_again"), \
class: "js-deny btn btn-primary", \
style: "display: inherit", \
"data-piwik-action": "RetryVerificationClicked", \
"data-piwik-name": "Clicked", \
"data-piwik-value": "SiteChannelFlow" \
style: "display: inherit"
)
= link_to t(".close"), "#", class: "js-deny btn btn-outline-primary"
5 changes: 1 addition & 4 deletions app/views/site_channels/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
= recaptcha_tags
= f.submit( \
t("shared.continue"), \
class: "btn btn-block btn-primary", \
"data-piwik-action": "ContactInfoClicked", \
"data-piwik-name": "Clicked", \
"data-piwik-value": "ContactInfoFlow" \
class: "btn btn-block btn-primary" \
)

script id="site-channel-ads-learn-more-modal" type="text/html"
Expand Down
4 changes: 2 additions & 2 deletions app/views/site_channels/verification_choose_method.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.two-options--subheader.two-options--subheader--recommended= t ".trusted_file.subheading"
.two-options--image-wrapper
= image_tag("[email protected]", class: "two-options--image", width: 234, height: 137)
div= link_to(t(".trusted_file.button"), verification_public_file_site_channel_path(current_channel), class: "btn btn-block btn-primary", :"data-piwik-action" => "ChosePublicFileClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "ChooserFlow")
div= link_to(t(".trusted_file.button"), verification_public_file_site_channel_path(current_channel), class: "btn btn-block btn-primary")

.two-options--or
= t ".or"
Expand All @@ -27,4 +27,4 @@
.two-options--subheader= t ".dns.subheading"
.two-options--image-wrapper
= image_tag("[email protected]", class: "two-options--image", width: 253, height: 96)
div= link_to(t(".dns.button"), verification_dns_record_site_channel_path(current_channel), class: "btn btn-block btn-outline-primary", :"data-piwik-action" => "ChoseDNSClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "ChooserFlow")
div= link_to(t(".dns.button"), verification_dns_record_site_channel_path(current_channel), class: "btn btn-block btn-outline-primary")
7 changes: 2 additions & 5 deletions app/views/site_channels/verification_dns_record.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ script type="text/html" id="verification_failed_modal_wrapper" data-open-verific
) do |f|
= f.submit( \
t(".button"), \
class: "btn btn-wide btn-primary", \
"data-piwik-action": "DNSVerificationClicked", \
"data-piwik-name": "Clicked", \
"data-piwik-value": "DNSFlow" \
class: "btn btn-wide btn-primary" \
)
= link_to(t("site_channels.shared.finish_verification_later"), home_publishers_path, class: "site-channels--finish-later", :"data-piwik-action" => "DNSFinishLaterClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "DNSFlow")
= link_to(t("site_channels.shared.finish_verification_later"), home_publishers_path, class: "site-channels--finish-later")
a href="#" data-js-confirm-with-modal="dns-services"
span.icon= render "icon_help"

Expand Down
6 changes: 3 additions & 3 deletions app/views/site_channels/verification_github.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ script type="text/html" id="verification_failed_modal_wrapper" data-open-verific
li
p= t ".nojekyll_html"
li
p= t "site_channels.shared.verification_file.download_html", download_link: link_to(t("shared.download"), download_verification_file_site_channel_path, class: "download-link", :"data-piwik-action" => "GithubDownloadFileClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "GithubFlow")
p= t "site_channels.shared.verification_file.download_html", download_link: link_to(t("shared.download"), download_verification_file_site_channel_path, class: "download-link")
.icon-and-text--wrapper
.icon-and-text--icon.icon-and-text--icon--top
= image_tag("[email protected]")
Expand All @@ -45,5 +45,5 @@ script type="text/html" id="verification_failed_modal_wrapper" data-open-verific

.panel-controls
= form_for(current_channel, method: :patch, url: verify_site_channel_path(current_channel)) do |f|
= f.submit(t("site_channels.shared.verify_button"), class: "btn btn-wide btn-primary", :"data-piwik-action" => "GithubVerificationClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "GithubFlow")
= link_to(t("site_channels.shared.finish_verification_later"), home_publishers_path, class: "site-channels--finish-later", :"data-piwik-action" => "GithubFinishLaterClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "GithubFlow")
= f.submit(t("site_channels.shared.verify_button"), class: "btn btn-wide btn-primary")
= link_to(t("site_channels.shared.finish_verification_later"), home_publishers_path, class: "site-channels--finish-later")
6 changes: 3 additions & 3 deletions app/views/site_channels/verification_public_file.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ script type="text/html" id="verification_failed_modal_wrapper" data-open-verific
div class=(current_channel.details.supports_https? ? "instructions" : "instructions dimmed")
ol.site-channels--body-list
li
p= t "site_channels.shared.verification_file.download_html", download_link: link_to(t("shared.download"), download_verification_file_site_channel_path, class: "download-link", :"data-piwik-action" => "PublicFileDownloadFileClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "PublicFileFlow")
p= t "site_channels.shared.verification_file.download_html", download_link: link_to(t("shared.download"), download_verification_file_site_channel_path, class: "download-link")
.icon-and-text--wrapper
.icon-and-text--icon.icon-and-text--icon--top
= image_tag("[email protected]", width: 63, height: 78)
Expand All @@ -41,5 +41,5 @@ script type="text/html" id="verification_failed_modal_wrapper" data-open-verific

.panel-controls
= form_for(current_channel.details, method: :patch, url: verify_site_channel_path(current_channel)) do |f|
= f.submit(t("site_channels.shared.verify_button"), class: "btn btn-wide btn-primary", :"data-piwik-action" => "PublicFileVerificationClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "PublicFileFlow")
= link_to(t("site_channels.shared.finish_verification_later"), home_publishers_path, class: "site-channels--finish-later", :"data-piwik-action" => "PublicFileFinishLaterClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "PublicFileFlow")
= f.submit(t("site_channels.shared.verify_button"), class: "btn btn-wide btn-primary")
= link_to(t("site_channels.shared.finish_verification_later"), home_publishers_path, class: "site-channels--finish-later")
4 changes: 2 additions & 2 deletions app/views/static/no_js.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
p= t ".new.body"
.row.form-row
.col.col-xs-12.col-sm-12
= link_to(t("shared.get_started"), sign_up_publishers_path, class: "btn btn-block btn-primary", :"data-piwik-action" => "StartSignupClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Landing")
= link_to(t("shared.get_started"), sign_up_publishers_path, class: "btn btn-block btn-primary")
.col.col-xs-12.col-sm-4.button-column
= link_to(t("shared.log_in"), log_in_publishers_path, class: "btn btn-block btn-secondary", :"data-piwik-action" => "LandingLoginClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Landing")
= link_to(t("shared.log_in"), log_in_publishers_path, class: "btn btn-block btn-secondary")
hr.divider
.row
.col.col-xs-12.col-sm-12
Expand Down
2 changes: 1 addition & 1 deletion app/views/totp_registrations/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
= render 'smartphone_with_code_tilted'

.col-halves
.col-half= f.submit t(".submit_value"), class: "btn btn-primary", :"data-piwik-action" => "TOTPLoginClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Authentication"
.col-half= f.submit t(".submit_value"), class: "btn btn-primary"
.col-half.text-right= link_to t("shared.cancel"), security_publishers_path, class: "btn btn-link"
2 changes: 1 addition & 1 deletion app/views/u2f_registrations/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

.col-halves
.col-half
= f.submit t(".submit_value"), class: "btn btn-primary", :"data-piwik-action" => "U2FLoginClicked", :"data-piwik-name" => "Clicked", :"data-piwik-value" => "Authentication"
= f.submit t(".submit_value"), class: "btn btn-primary"
.col-half.text-right
= link_to t("shared.cancel"), security_publishers_path, class: "btn btn-link"

Expand Down
Loading

0 comments on commit ca87213

Please sign in to comment.