{
  "plugin_slug": "nsc_gabt_settings",
  "plugin_name": "GA Backend Tracking",
  "plugin_prefix": "nsc_gabt_",
  "setting_page_fields": {
    "active_tab_slug": "",
    "active_tab_index": 0,
    "tabs": [
      {
        "tabname": "General",
        "tab_slug": "general",
        "active": false,
        "tabfields": [
          {
            "field_slug": "activate",
            "type": "checkbox",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "As soon as you activate this plugin and enter a property id, tracking calls are sent to Google Analytics.",
            "name": "Activate Tracking",
            "save_in_db": true
          },
          {
            "field_slug": "propertyid",
            "type": "text",
            "required": false,
            "extra_validation_name": "nsc_gabt_validate_property_id",
            "pre_selected_value": "",
            "helpertext": "Please enter a valid Property Id, for example: UA-123456789-1. Use a new one, do not mix with tracking from another tracking solution.",
            "name": "GA Property ID",
            "save_in_db": true
          }
        ]
      },
      {
        "tabname": "Custom Dimensions",
        "tab_slug": "custom_dimensions",
        "active": false,
        "tabfields": [
          {
            "field_slug": "cd_index_useragent",
            "type": "text",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "If you want to save the user agent in a custom dimension, put here the cd index.",
            "name": "CD Index for user agent",
            "save_in_db": true
          },
          {
            "field_slug": "cd_index_rawurl",
            "type": "text",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "If you want to save the raw url in a custom dimension, put here the cd index.",
            "name": "CD Index for raw url",
            "save_in_db": true
          },
          {
            "field_slug": "cd_index_rawreferrer",
            "type": "text",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "If you want to save the raw referrer in a custom dimension, put here the cd index.",
            "name": "CD Index for raw referrer",
            "save_in_db": true
          },
          {
            "field_slug": "cd_index_frontend_cid",
            "type": "text",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "If you want to save the client id of frontend tracking in a custom dimension, put here the cd index.",
            "name": "CD Index for client id of frontend tracking",
            "save_in_db": true
          },
          {
            "field_slug": "cd_index_plugin_cid",
            "type": "text",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "If you want to save the client id of this plugin in a custom dimension, put here the cd index. This is required if you want to compare cookieless vs. cookie tracking.",
            "name": "CD Index for client id of this plugin",
            "save_in_db": true
          }
        ]
      },
      {
        "tabname": "Enhanced Ecommerce",
        "tab_slug": "enhanced_ecommerce",
        "active": false,
        "tabfields": [
          {
            "field_slug": "eec_prevent_duplicate_orders",
            "type": "checkbox",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": true,
            "helpertext": "Google Analytics prevents duplicate order tracking only within the same session. If you activate this, an additional meta field will be added to the order, to mark it as tracked.",
            "name": "Prevent duplicate order tracking",
            "save_in_db": true
          }
        ]
      },
      {
        "tabname": "Traffic Filter",
        "tab_slug": "filter_traffic",
        "active": false,
        "tabfields": [
          {
            "field_slug": "default_bot_filter_enabled",
            "type": "checkbox",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "Will filter against a list of known bots. See regexp here: <a href='{{regexURL}}' target='_blank'>List</a>. List comes mainly from this repo: https://github.com/monperrus/crawler-user-agents. Most of the bots here will be already filtered out if you activate bot filtering for google analytics.",
            "name": "Enable default bot filter",
            "save_in_db": true
          },
          {
            "field_slug": "propertyid_for_bots",
            "type": "text",
            "required": false,
            "extra_validation_name": "nsc_gabt_validate_property_id_for_bots",
            "pre_selected_value": "",
            "helpertext": "If you want to get an Idea of your bot traffic you can add a property id, where your bot traffic will be tracked. Make sure, that you DISABLE the bot filter in this google analytics property/view.",
            "name": "GA Property ID to send bot traffic",
            "save_in_db": true
          },
          {
            "field_slug": "filter_user_agents_custom_regexp",
            "type": "textarea",
            "required": false,
            "extra_validation_name": "validateRegexp",
            "pre_selected_value": "",
            "helpertext": "Aditional to the default list you can add here your custom regexp, like: GoogleBot.*. Please do not add '/' at the beginning or end.",
            "name": "Filter User Agents (regexp)",
            "save_in_db": true
          },
          {
            "field_slug": "filter_ips",
            "type": "textarea",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": "",
            "helpertext": "A comma separated list. If you have IP adresses you do not want to track, you can add them here as comma separated list.",
            "name": "Filter IP (comma separated)",
            "save_in_db": true
          }
        ]
      },
      {
        "tabname": "Privacy",
        "tab_slug": "data_privacy",
        "active": false,
        "tabfields": [
          {
            "field_slug": "anonymizeip",
            "type": "select",
            "required": false,
            "selectable_values": [
              { "value": "yes", "name": "Yes" },
              { "value": "no", "name": "No" },
              { "value": "dontsend", "name": "Don't send user ip." }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "yes",
            "helpertext": "Do you want to anonymize the user IP. Required to be compliant with data privacy laws of some countries, like all EU countries. You can choose to not send any IP, then Google Analytics will use the IP of your server as user ip. Depending on your settings you don't sent any PIIs anymore. Which might be usefull if you want to track without a consent. But not sending user ips means that the user location won't work and you might run into trouble regarding bot filtering.",
            "name": "Anonymize IP",
            "save_in_db": true
          },
          {
            "field_slug": "ignoredonottrack",
            "type": "radio",
            "required": false,
            "selectable_values": [
              { "value": "yes", "name": "Yes" },
              { "value": "no", "name": "No" }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "no",
            "helpertext": "",
            "name": "Ignore 'do not track'",
            "save_in_db": true
          },
          {
            "field_slug": "overrideuseragent",
            "type": "longtext",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": "",
            "helpertext": "If you set here a text, this text will be sent to google analytics as user agent. So the useragent of the user is not sent to GA anymore. This will destroy some reports, and might make the Google Analytics bot filter useless, but you prevent sending any kind of user identifing data to google.",
            "name": "Override user agent",
            "save_in_db": true
          },
          {
            "field_slug": "cidgeneration",
            "type": "select",
            "required": false,
            "selectable_values": [
              { "value": "own", "name": "created by plugin" },
              { "value": "cookieless", "name": "cookieless" },
              { "value": "cookielessReset", "name": "cookieless with reset at Midnight" },
              { "value": "random", "name": "randomly generated" }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "own",
            "helpertext": "If you choose 'cookieless' the ClientID will be created out of a hash from IP, Useragent and DNT Settings, in short: a very primitive fingerprint for more information see plugin description. With 'random' there will be with each pageview a new user, because User id is not stored in cookie. Only change it to 'random' if you know what you are doing.",
            "name": "Client ID Generation",
            "save_in_db": true
          },
          {
            "field_slug": "typeofcompliance",
            "type": "select",
            "required": false,
            "selectable_values": [
              { "value": "optin", "name": "Opt-In" },
              { "value": "optout", "name": "Opt-Out" },
              { "value": "notpossible", "name": "Opt-Out/In not possible" }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "optout",
            "helpertext": "Depending on your privacy settings of this plugin you might need a consent from the user. If checked to 'not possible' tracking request will be sent to GA, regardless of any cookies which were set before. You can use this shortcode, please adapt the text according to your compliance type: [nsc_gabt_opt_out_link linktext='tracking opt out' linktext_success='you have opted out.'].",
            "name": "Compliance Type",
            "save_in_db": true
          },
          {
            "field_slug": "consentcookiename",
            "type": "text",
            "required": false,
            "pre_selected_value": "cookieconsent_status",
            "extra_validation_name": false,
            "helpertext": "You can use your own/existing opt out/in cookie here. <br>Opt-Out: As soon as a consent cookie exist, there won't be any tracking. IF no cookie value is defined, see below. <br> Opt-In: Only IF the consent cookie exist there will be tracking. IF no cookie value is defined, see below. <br> If you need an consent link to create a consent cookie you can use this short code: <b>[nsc_gabt_opt_out_link linktext='tracking opt out' linktext_success='you have opted out.']</b>. The Link will create a cookie with a lifetime of one year, with the specified name.",
            "name": "Name of consent cookie",
            "save_in_db": true
          },
          {
            "field_slug": "consentcookievalue",
            "type": "text",
            "required": false,
            "pre_selected_value": "",
            "extra_validation_name": false,
            "helpertext": "If you leave this blank, the value of the consent cookie does not matter. If you provide a value, the opt out or opt in will only be working if the cookie has the EXACT value.",
            "name": "Value of consent cookie",
            "save_in_db": true
          }
        ]
      },
      {
        "tabname": "Debug",
        "tab_slug": "debug",
        "active": false,
        "tabfields": [
          {
            "field_slug": "debug",
            "type": "radio",
            "required": false,
            "selectable_values": [
              { "value": "true", "name": "True" },
              { "value": "false", "name": "False" }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "false",
            "helpertext": "Don't set this to true on live environments. It will record every hit, which is sent to Google Analytics. But for Performance reasons only the last 100.",
            "name": "Write GA request log file.",
            "save_in_db": true
          },
          {
            "field_slug": "debug_to_frontend",
            "type": "radio",
            "required": false,
            "selectable_values": [
              { "value": "true", "name": "True" },
              { "value": "false", "name": "False" }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "false",
            "helpertext": "If this is true AND if there is a cookie with the name 'nsc_gabt_log_to_fe' AND it is not a POST request, it will log request info in the browser console and write it to a JS Variable: nsc_gabt_fe_debug_output.",
            "name": "Log requests to FE for GET and if cookie set",
            "save_in_db": true
          },
          {
            "field_slug": "youroptoutstatus",
            "type": "textarea",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": "",
            "helpertext": "This shows how your privacy settings affects your tracking. One test scenario would be, to click the opt out link and see how your status changes.",
            "name": "Are you tracked by this plugin?",
            "save_in_db": false
          },
          {
            "field_slug": "requestlog",
            "type": "textarea",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": "",
            "helpertext": "If debug = true you find here the last 100 request which where sent to GA.",
            "name": "GA Request Logs",
            "save_in_db": false
          }
        ]
      },
      {
        "tabname": "Advanced",
        "tab_slug": "advanced_settings",
        "active": false,
        "tabfields": [
          {
            "field_slug": "tracking_url_target",
            "type": "select",
            "required": false,
            "selectable_values": [
              { "value": "only_ga", "name": "GA only" },
              {
                "value": "only_custom_url",
                "name": "Custom Tracking URL only"
              },
              { "value": "both", "name": "GA and Custom URL" }
            ],
            "extra_validation_name": false,
            "pre_selected_value": "only_ga",
            "helpertext": "To which URL do you want to sent the hit? To your custom URL, specified beneath, only to GA or to both. If the custom tracking URL is not a valid URL, it will be send to GA.",
            "name": "Tracking URL target",
            "save_in_db": true
          },
          {
            "field_slug": "custom_tracking_url",
            "type": "longtext",
            "required": false,
            "pre_selected_value": "",
            "extra_validation_name": "nsc_gabt_validate_url",
            "helpertext": "If you want to send the hit to another URL, not to https://www.google-analytics.com/collect you can specify it here. Please only use it if you really know what you are doing. If this field is blank or an invalid URL, the hit will be sent to Ga.",
            "name": "Custom Tracking URL",
            "save_in_db": true
          },
          {
            "field_slug": "trackingcookiename",
            "type": "text",
            "required": true,
            "extra_validation_name": false,
            "pre_selected_value": "gabtnsc_",
            "helpertext": "Here you can change the name of the tracking cookie. It is only relevant if you choose client id generation 'created by plugin'. BE AWARE: if you change the name you will reset all exiting user/client id. All users with an id with the old cookie name will be recognized as new users.",
            "name": "Tracking Cookie Name",
            "save_in_db": true
          },
          {
            "field_slug": "comparecids",
            "type": "checkbox",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "You can compare different cid generator methods. Therefore you need a test property id and a custom dimension",
            "name": "Compare different cid generator methods",
            "save_in_db": true
          },
          {
            "field_slug": "propertyidcidtest",
            "type": "text",
            "required": false,
            "extra_validation_name": "nsc_gabt_validate_property_id",
            "pre_selected_value": "",
            "helpertext": "Dont use your productive property id! This property id will be used to collect the test data. BE AWARE: for each page view/event there will be two additional hits.",
            "name": "GA Property ID for Test",
            "save_in_db": true
          },
          {
            "field_slug": "cd_index_cid_generation_type",
            "type": "text",
            "required": false,
            "extra_validation_name": false,
            "pre_selected_value": false,
            "helpertext": "You have to create filter in GA, to separate the different types. Possible values are: created by plugin, cookieless, created by GA library",
            "name": "CD Index for type of cid generation",
            "save_in_db": true
          }
        ]
      }
    ]
  }
}
