diff --git a/ci/clitesten b/ci/clitesten index 4079a7c2d..bba97aad0 100644 --- a/ci/clitesten +++ b/ci/clitesten @@ -2476,6 +2476,14 @@ def test_metrika(){ powershell encoding: 'UTF-8', script:'./oint.exe metrika GetTagsList --token "test" --debug --test ' } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + powershell encoding: 'UTF-8', script:'./oint.exe metrika CreateCounter --token "test" --fields "test" --debug --test ' + } + + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + powershell encoding: 'UTF-8', script:'./oint.exe metrika DeleteCounter --token "test" --counter "test" --debug --test ' + } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { powershell encoding: 'UTF-8', script:'./oint.exe metrika GetCounterStructure --empty "test" --debug --test ' } diff --git a/ci/clitestru b/ci/clitestru index b5cf617b5..6d5390f07 100644 --- a/ci/clitestru +++ b/ci/clitestru @@ -2476,6 +2476,14 @@ def test_metrika(){ powershell encoding: 'UTF-8', script:'./oint.exe metrika ПолучитьСписокМеток --token "test" --debug --test ' } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + powershell encoding: 'UTF-8', script:'./oint.exe metrika СоздатьСчетчик --token "test" --fields "test" --debug --test ' + } + + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + powershell encoding: 'UTF-8', script:'./oint.exe metrika УдалитьСчетчик --token "test" --counter "test" --debug --test ' + } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { powershell encoding: 'UTF-8', script:'./oint.exe metrika ПолучитьСтруктуруСчетчика --empty "test" --debug --test ' } diff --git a/docs/en/data/YandexMetrika/CreateCounter.json b/docs/en/data/YandexMetrika/CreateCounter.json new file mode 100644 index 000000000..2e8b30572 --- /dev/null +++ b/docs/en/data/YandexMetrika/CreateCounter.json @@ -0,0 +1,3 @@ +{ +"Token": "y0_AgAAAABdylaOAAy9KgAAAAEXh6i..." +} \ No newline at end of file diff --git a/docs/en/data/YandexMetrika/DeleteCounter.json b/docs/en/data/YandexMetrika/DeleteCounter.json new file mode 100644 index 000000000..49482abfa --- /dev/null +++ b/docs/en/data/YandexMetrika/DeleteCounter.json @@ -0,0 +1,4 @@ +{ +"Token": "y0_AgAAAABdylaOAAy9KgAAAAEXh6i...", +"CounterID": 98873524 +} \ No newline at end of file diff --git a/docs/en/examples/YandexMetrika/CreateCounter.txt b/docs/en/examples/YandexMetrika/CreateCounter.txt new file mode 100644 index 000000000..54fd4fa3d --- /dev/null +++ b/docs/en/examples/YandexMetrika/CreateCounter.txt @@ -0,0 +1,46 @@ + Token = "y0_AgAAAABdylaOAAy9KgAAAAEXh6i..."; + + CounterStructure = New Structure; + CounterStructure.Insert("autogoals_enabled", True); + + CodeSettingsStructure = New Structure; + CodeSettingsStructure.Insert("async" , 0); + CodeSettingsStructure.Insert("clickmap" , 1); + CodeSettingsStructure.Insert("ecommerce" , 1); + CodeSettingsStructure.Insert("in_one_line" , 0); + CodeSettingsStructure.Insert("track_hash" , 1); + CodeSettingsStructure.Insert("visor" , 1); + CodeSettingsStructure.Insert("xml_site" , 0); + CodeSettingsStructure.Insert("ytm" , 0); + CodeSettingsStructure.Insert("alternative_cdn", 1); + + InformerStructure = New Structure; + InformerStructure.Insert("color_arrow", 1); + InformerStructure.Insert("color_end" , "EFEFEFFE"); + InformerStructure.Insert("color_start", "EEEEEEEE"); + InformerStructure.Insert("color_text" , 0); + InformerStructure.Insert("enabled" , 1); + InformerStructure.Insert("indicator" , "uniques"); + InformerStructure.Insert("size" , 2); + InformerStructure.Insert("type" , "ext"); + + CodeSettingsStructure.Insert("informer", InformerStructure); + + CounterStructure.Insert("code_options", CodeSettingsStructure); + + FlagsStructure = New Structure; + FlagsStructure.Insert("collect_first_party_data" , True); + FlagsStructure.Insert("measurement_enabled" , True); + FlagsStructure.Insert("use_in_benchmarks" , True); + FlagsStructure.Insert("direct_allow_use_goals_without_access", True); + + CounterStructure.Insert("counter_flags" , FlagsStructure); + CounterStructure.Insert("favorite" , 1); + CounterStructure.Insert("filter_robots" , 2); + CounterStructure.Insert("gdpr_agreement_accepted", 1); + + DomainStructure = New Structure("site", "openintegrations.dev"); + + CounterStructure.Insert("site2", DomainStructure); + + Result = OPI_YandexMetrika.CreateCounter(Token, CounterStructure); diff --git a/docs/en/examples/YandexMetrika/DeleteCounter.txt b/docs/en/examples/YandexMetrika/DeleteCounter.txt new file mode 100644 index 000000000..10339d5fd --- /dev/null +++ b/docs/en/examples/YandexMetrika/DeleteCounter.txt @@ -0,0 +1,4 @@ + Token = "y0_AgAAAABdylaOAAy9KgAAAAEXh6i..."; + CounterID = "98873524"; + + Result = OPI_YandexMetrika.DeleteCounter(Token, CounterID); diff --git a/docs/en/md/Yandex_Metrika/Counters-management/Create-counter.mdx b/docs/en/md/Yandex_Metrika/Counters-management/Create-counter.mdx new file mode 100644 index 000000000..24fb64bfe --- /dev/null +++ b/docs/en/md/Yandex_Metrika/Counters-management/Create-counter.mdx @@ -0,0 +1,83 @@ +--- +sidebar_position: 1 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Create counter + Creates a counter by field description + + + +`Function CreateCounter(Val Token, Val CounterStructure) Export` + + | Parameter | CLI option | Type | Required | Description | + |-|-|-|-|-| + | Token | --token | String | ✔ | Auth token | + | CounterStructure | --fields | Structure of KeyAndValue | ✔ | Counter structure. See GetCounterStructure | + + + Returns: Map Of KeyAndValue - serialized JSON response from Yandex + +
+ +:::tip +Method at API documentation: [Creating a counter](https://yandex.ru/dev/metrika/en/management/openapi/counter/addCounter) +::: +
+ + +```bsl title="1C:Enterprise/OneScript code example" + Token = "y0_AgAAAABdylaOAAy9KgAAAAEXh6i..."; + + CounterStructure = New Structure; + CounterStructure.Insert("autogoals_enabled", True); + + CodeSettingsStructure = New Structure; + CodeSettingsStructure.Insert("async" , 0); + CodeSettingsStructure.Insert("clickmap" , 1); + CodeSettingsStructure.Insert("ecommerce" , 1); + CodeSettingsStructure.Insert("in_one_line" , 0); + CodeSettingsStructure.Insert("track_hash" , 1); + CodeSettingsStructure.Insert("visor" , 1); + CodeSettingsStructure.Insert("xml_site" , 0); + CodeSettingsStructure.Insert("ytm" , 0); + CodeSettingsStructure.Insert("alternative_cdn", 1); + + InformerStructure = New Structure; + InformerStructure.Insert("color_arrow", 1); + InformerStructure.Insert("color_end" , "EFEFEFFE"); + InformerStructure.Insert("color_start", "EEEEEEEE"); + InformerStructure.Insert("color_text" , 0); + InformerStructure.Insert("enabled" , 1); + InformerStructure.Insert("indicator" , "uniques"); + InformerStructure.Insert("size" , 2); + InformerStructure.Insert("type" , "ext"); + + CodeSettingsStructure.Insert("informer", InformerStructure); + + CounterStructure.Insert("code_options", CodeSettingsStructure); + + FlagsStructure = New Structure; + FlagsStructure.Insert("collect_first_party_data" , True); + FlagsStructure.Insert("measurement_enabled" , True); + FlagsStructure.Insert("use_in_benchmarks" , True); + FlagsStructure.Insert("direct_allow_use_goals_without_access", True); + + CounterStructure.Insert("counter_flags" , FlagsStructure); + CounterStructure.Insert("favorite" , 1); + CounterStructure.Insert("filter_robots" , 2); + CounterStructure.Insert("gdpr_agreement_accepted", 1); + + DomainStructure = New Structure("site", "openintegrations.dev"); + + CounterStructure.Insert("site2", DomainStructure); + + Result = OPI_YandexMetrika.CreateCounter(Token, CounterStructure); +``` + + + + + diff --git a/docs/en/md/Yandex_Metrika/Counters-management/Delete-counter.mdx b/docs/en/md/Yandex_Metrika/Counters-management/Delete-counter.mdx new file mode 100644 index 000000000..e0a3a771a --- /dev/null +++ b/docs/en/md/Yandex_Metrika/Counters-management/Delete-counter.mdx @@ -0,0 +1,41 @@ +--- +sidebar_position: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Delete counter + Deletes a counter by ID + + + +`Function DeleteCounter(Val Token, Val CounterID) Export` + + | Parameter | CLI option | Type | Required | Description | + |-|-|-|-|-| + | Token | --token | String | ✔ | Auth token | + | CounterID | --counter | Number, String | ✔ | Counter ID for deletion | + + + Returns: Map Of KeyAndValue - serialized JSON response from Yandex + +
+ +:::tip +Method at API documentation: [Deleting a counter](https://yandex.ru/dev/metrika/en/management/openapi/counter/deleteCounter) +::: +
+ + +```bsl title="1C:Enterprise/OneScript code example" + Token = "y0_AgAAAABdylaOAAy9KgAAAAEXh6i..."; + CounterID = "98873524"; + + Result = OPI_YandexMetrika.DeleteCounter(Token, CounterID); +``` + + + + + diff --git a/docs/en/md/Yandex_Metrika/Counters-management/Get-counter-structure.mdx b/docs/en/md/Yandex_Metrika/Counters-management/Get-counter-structure.mdx index ddab88fea..f4d29525a 100644 --- a/docs/en/md/Yandex_Metrika/Counters-management/Get-counter-structure.mdx +++ b/docs/en/md/Yandex_Metrika/Counters-management/Get-counter-structure.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 3 --- import Tabs from '@theme/Tabs'; @@ -34,4 +34,118 @@ Description in the API documentation: [Creating a counter](https://yandex.ru/dev - +```json title="Result" +{ + "autogoals_enabled": "", + "code_options": { + "async": "", + "clickmap": "", + "ecommerce": "", + "in_one_line": "", + "track_hash": "", + "visor": "", + "xml_site": "", + "ytm": "", + "alternative_cdn": "", + "informer": { + "color_arrow": "", + "color_end": "", + "color_start": "", + "color_text": "", + "enabled": "", + "indicator": "", + "size": "", + "type": "" + } + }, + "counter_flags": { + "collect_first_party_data": "", + "measurement_enabled": "", + "use_in_benchmarks": "", + "direct_allow_use_goals_without_access": "" + }, + "favorite": "", + "filter_robots": "", + "filters": [ + { + "action": "", + "attr": "", + "status": "", + "type": "", + "end_ip": "", + "id": "", + "start_ip": "", + "value": "", + "with_subdomains": "" + } + ], + "gdpr_agreement_accepted": "", + "goals": [ + { + "name": "", + "type": "", + "default_price": "", + "id": "", + "is_favorite": "" + } + ], + "grants": [ + { + "perm": "", + "comment": "", + "partner_data_access": "", + "user_login": "", + "user_uid": "" + } + ], + "labels": [ + { + "name": "" + } + ], + "measurement_tokens": "", + "mirrors2": [ + { + "site": "" + } + ], + "name": "", + "offline_options": { + "offline_calls_extended_threshold": "", + "offline_conversion_extended_threshold": "", + "offline_visits_extended_threshold": "" + }, + "operations": [ + { + "action": "", + "attr": "", + "status": "", + "id": "", + "value": "" + } + ], + "owner_login": "", + "permission": "", + "publisher_options": { + "enabled": "", + "schema": "", + "schema_options": "" + }, + "site2": [ + { + "site": "" + } + ], + "source": "", + "time_zone_name": "