Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-tracker/etc/adminhtml/system.xml

Summary

Maintainability
Test Coverage
<!--
/**
 * Smile Tracker module configuration
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
 * versions in the future.
 *
 * @category  Smile
 * @package   Smile\ElasticsuiteTracker
 * @author    Romain RUAUD <romain.ruaud@smile.fr>
 * @copyright 2020 Smile
 * @license   Open Software License ("OSL") v. 3.0
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="smile_elasticsuite_tracker" translate="label" type="text" sortOrder="910" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Tracking</label>
            <tab>smile_elasticsuite</tab>
            <resource>Magento_Backend::smile_elasticsuite_tracker</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Global Configuration</label>
                <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                    <label>Enabled</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="retention_delay" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Retention delay</label>
                    <validate>integer validate-greater-than-zero</validate>
                    <comment><![CDATA[In months (default is 12 months.).<br /> Tracking data older than this will be removed each day.]]></comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="use_api" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Use the API to collect data</label>
                    <comment><![CDATA[If set to Yes, the tracking script will use the dedicated Rest API endpoint to send its data instead of using the legacy invisible pixel method. Useful if you have issues white-listing the tracker image URL with parameters in your frontend cache or if you customized the data collection and the tracker needs to send bigger payloads than usual.]]></comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
                <field id="is_headless_mode" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Headless mode</label>
                    <comment><![CDATA[If set to Yes, magento will assume that all the events are managed by the front app. No event will be added from php directly.]]></comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
            </group>
            <group id="session" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Session Configuration</label>
                <field id="visit_cookie_name" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Visit Cookie Name</label>
                </field>
                <field id="visit_cookie_lifetime" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Visit Cookie Lifetime</label>
                    <validate>integer validate-greater-than-zero</validate>
                    <comment><![CDATA[In seconds. (Default is 3600 sec.)<br /> Without any activity under this delay we start a new visit.]]></comment>
                </field>
                <field id="visitor_cookie_name" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Visitor Cookie Name</label>
                </field>
                <field id="visitor_cookie_lifetime" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Visitor Cookie Lifetime</label>
                    <validate>integer validate-greater-than-zero</validate>
                    <comment><![CDATA[In days. (Default is 365 days.)<br /> This cookie will be stick to the customer to allow multiple session aggregation.]]></comment>
                </field>
            </group>
            <group id="anonymization" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Tracking Anonymization</label>
                <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                    <label>Anonymize customer data after a delay.</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="delay" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                    <label>Anonymization Delay</label>
                    <validate>integer validate-greater-than-zero</validate>
                    <comment><![CDATA[In days. (Default is 365 days.)<br /> Tracked customer related data will be anonymized after this delay.]]></comment>
                    <depends>
                        <field id="enabled">1</field>
                    </depends>
                </field>
            </group>
            <group id="queue_cleanup" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Queue cleanup configuration</label>
                <field id="delay" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Delay</label>
                    <validate>integer validate-greater-than-zero</validate>
                    <comment><![CDATA[In days. (Default is 7 days.)<br />Invalid tracker events older than this delay are periodically removed from the events indexing queue.]]></comment>
                </field>
                <field id="purge_now" translate="button_label" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="0">
                    <label/>
                    <frontend_model>Smile\ElasticsuiteTracker\Block\Adminhtml\System\Config\PurgeQueue</frontend_model>
                    <comment><![CDATA[You can click this button to immediately remove all the invalid tracker events from the indexing queue, regardless of the Delay setting above.]]></comment>
                </field>
            </group>
        </section>
        <section id="smile_elasticsuite_telemetry" translate="label" type="text" sortOrder="911" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Telemetry</label>
            <tab>smile_elasticsuite</tab>
            <resource>Magento_Backend::smile_elasticsuite_telemetry</resource>
            <group id="telemetry" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Telemetry</label>
                <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                    <label>Enable telemetry</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
        </section>
    </system>
</config>