{% extends "dashboard.twig" %}

{% block notification %}{% endblock %}

{% block topcontrols %}
    {% include "@CoreHome/_siteSelectHeader.twig" %}
{% endblock %}

{% block content %}

    <script type="text/javascript" charset="utf-8">
        $(document).ready(function () {
            $('<div />').insertAfter('.site-without-data').liveWidget({
                interval: 1000,
                onUpdate: function () {
                    // reload page as soon as a visit was detected
                    broadcast.propagateNewPage('date=today');
                },
                dataUrlParams: {
                    module: 'Live',
                    action: 'getLastVisitsStart'
                }
            });
        });
    </script>

    <div class="site-without-data">
        <div piwik-content-block content-title="{{ 'SitesManager_SiteWithoutDataTitle'|translate|e('html_attr') }}">

        <p>
            {{ 'SitesManager_SiteWithoutDataDescription'|translate }}
            {{ 'SitesManager_SiteWithoutDataSetupTracking'|translate('<a href="' ~ linkTo({
                'module': 'CoreAdminHome',
                'action': 'trackingCodeGenerator',
            }) ~ '">', "</a>")|raw }}
        </p>

        <p>
            {{ 'SitesManager_SiteWithoutDataMessageDisappears'|translate }}
            {{ 'SitesManager_SiteWithoutDataSetupGoals'|translate('<a href="' ~ linkTo({
                'module': 'Goals',
                'action': 'manage',
            }) ~ '">', "</a>",
            '<a href="https://matomo.org/features/" rel="noreferrer noopener" target="_blank">', "</a>",
            '<a href="https://matomo.org/docs/" rel="noreferrer noopener" target="_blank">', "</a>",
            '<a href="https://matomo.org/faq/" rel="noreferrer noopener" target="_blank">', "</a>")|raw }}
<br />
        </p>

            <div class='trackingHelp'>

                <h3>Integrations</h3>
                <p>{{ 'Installation_JSTracking_Intro'|translate }}</p>

                <p>{{ 'CoreAdminHome_JSTrackingIntro3a'|translate('<a href="https://matomo.org/integrate/" rel="noreferrer noopener" target="_blank">','</a>')|raw }} {{ 'CoreAdminHome_JSTrackingIntro3b'|translate|raw }}</p>

                <div class="valign-wrapper trackingHelpHeader">
                    <div>

                        <h3>{{ 'General_JsTrackingTag'|translate }}</h3>

                        <p>{{ 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead'|translate("&lt;/head&gt;")|raw }}</p>
                    </div>
                    <a class="btn" id="emailTrackingCodeBtn"
                       href="mailto:?subject={{ 'SitesManager_EmailInstructionsSubject'|translate|url_encode|e('html_attr') }}&body={{ emailBody|url_encode|e('html_attr') }}">
                        {{ 'SitesManager_EmailInstructionsButton'|translate }}
                    </a>
                </div>

                <pre piwik-select-on-focus>{{ jsTag|raw }}</pre>

                <p>{{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">','</a>')|raw }}</p>

                <p><br />{{ 'CoreAdminHome_JSTracking_EndNote'|translate('<a href="' ~ linkTo({'module': 'CoreAdminHome', 'action': 'trackingCodeGenerator'}) ~'">','</a>')|raw }}
                <br />
                <br />
                    <a href="{{ linkTo({module: 'CoreAdminHome', action: 'trackingCodeGenerator'}) }}"class="btn"><span class="icon-configure"></span> {{ 'SitesManager_CustomizeJavaScriptTracker'|translate }}</a></p>

                <h3>{{ 'SitesManager_LogAnalytics'|translate }}</h3>

                <p>{{ 'SitesManager_LogAnalyticsDescription'|translate('<a href="https://matomo.org/log-analytics/" rel="noreferrer noopener" target="_blank">', '</a>')|raw }}</p>

                <h3>{{ 'SitesManager_MobileAppsAndSDKs'|translate }}</h3>

                <p>{{ 'SitesManager_MobileAppsAndSDKsDescription'|translate('<a href="https://matomo.org/integrate/#programming-language-platforms-and-frameworks" rel="noreferrer noopener" target="_blank">','</a>')|raw }}</p>

                <h3>{{ 'CoreAdminHome_HttpTrackingApi'|translate }}</h3>
                <p>{{ 'CoreAdminHome_HttpTrackingApiDescription'|translate('<a href="https://developer.matomo.org/api-reference/tracking-api" rel="noreferrer noopener" target="_blank">','</a>')|raw }}</p>

                {% if googleAnalyticsImporterMessage is defined %}
                {{ googleAnalyticsImporterMessage|raw }}
                {% endif %}

                {{ postEvent('Template.endTrackingHelpPage') }}

            </div>

            {{ postEvent('Template.siteWithoutData.afterIntro') }}
            <br />
            <br />
            <a href="{{ linkTo({module: 'SitesManager', action: 'ignoreNoDataMessage'}) }}"
               class="btn ignoreSitesWithoutData">{{ 'SitesManager_SiteWithoutDataIgnoreMessage'|translate }}</a>

        </div>

        {{ postEvent('Template.siteWithoutData.afterTrackingHelp') }}
    </div>

{% endblock %}
