Sha256: 795cbe59b59003f595fc550169de9d9de0c34bbf4edce650128ca98ca48bf914

Contents?: true

Size: 1.84 KB

Versions: 3

Compression:

Stored size: 1.84 KB

Contents

<%
=begin

Lesli

Copyright (c) 2023, Lesli Technologies, S. A.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

Lesli · Ruby on Rails SaaS development platform.

Made with ♥ by https://www.lesli.tech
Building a better future, one line of code at a time.

@contact  hello@lesli.tech
@website  https://www.lesli.tech
@license  GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html

// · ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~
// · 
=end
%>


<% protected_controllers = ["confirmations"] %>

<% # Get an specific site tracking id or use the development default %>
<% tracking_id = Rails.application.credentials.dig(:providers, :analytics) || "" %>

<% # check if analytics is enabled in the settings file %>
<% enable_analytics = Lesli.config.security[:enable_analytics] %>

<% if Rails.env.production? && enable_analytics %>

    <% if !protected_controllers.include?(controller_name) %>

        <!-- Google tag (gtag.js) -->
        <script async src="https://www.googletagmanager.com/gtag/js?id=<%= tracking_id %>"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', '<%= tracking_id %>');
        </script>
    <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lesli-5.0.13 app/views/lesli/partials/_application-analytics.html.erb
lesli-5.0.11 app/views/lesli/partials/_application-analytics.html.erb
lesli-5.0.10 app/views/lesli/partials/_application-analytics.html.erb