diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-12-01 05:42:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-01 05:42:34 +0300 |
commit | 40a8d65d6dd8f4f5fc601b78becf981f38e69eb4 (patch) | |
tree | ab5919b6bee6b17669e1673a65e0d041127e0323 /tests/PHPUnit | |
parent | 66149092b5051ba79646cf2b0e471530343ff1f4 (diff) |
New "Event URL" segment `eventUrl` to segment on any Segment URL (#12236)
* New "Event URL" segment `eventUrl` to segment on any Segment URL
Useful for many use cases for example:
* Creating Custom Reports such as "Top page URLs by Event action"
* Segmenting by Event URL and view events triggered on a specific Page URL
* Fixes #11131 Action URL segment could filter both Page URLs OR Event URLs (as advertised originally in the 2.16.0 changelog but it wasn't actually fully working yet)
* fix typo no capital letter
* remove column type to prevent new column being created in the log_link_visit_action table
* set correct action type for segment eventUrl
* modify test
* eventUrl needs action data
* fix suggested values for eventUrl
* update test files
* event url is stored without protocol
* update test file
Diffstat (limited to 'tests/PHPUnit')
6 files changed, 46 insertions, 21 deletions
diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php index bf24a9d4af..f1f2fd2f2e 100644 --- a/tests/PHPUnit/Integration/SegmentTest.php +++ b/tests/PHPUnit/Integration/SegmentTest.php @@ -832,9 +832,10 @@ class SegmentTest extends IntegrationTestCase ON log_link_visit_action.idvisit = log_visit.idvisit WHERE (( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 1 )) ) OR ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 3 )) ) - OR ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 2 )) ) ) + OR ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 2 )) ) + OR ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 10 )) ) ) GROUP BY log_visit.idvisit ORDER BY NULL ) AS log_inner", - "bind" => array('myTestUrl', 'myTestUrl', 'myTestUrl')); + "bind" => array('myTestUrl', 'myTestUrl', 'myTestUrl', 'myTestUrl')); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); } diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__API.getSuggestedValuesForSegment.xml index 2e03969e6d..2aaf85d5c1 100644 --- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__API.getSuggestedValuesForSegment.xml +++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__API.getSuggestedValuesForSegment.xml @@ -1,23 +1,23 @@ <?xml version="1.0" encoding="utf-8" ?> <result> - <row>http://piwik.net/grue/lair</row> <row>http://piwik.net/space/quest/iv</row> - <row>http://example-outlink.org/1.html</row> + <row>http://piwik.net/grue/lair</row> <row>http://example.org/path/file1.zip</row> <row>http://example.org/path/file0.zip</row> + <row>http://example-outlink.org/1.html</row> <row>http://example-outlink.org/0.html</row> - <row>http://example.org/path/file2.zip</row> - <row>http://example.org/path/file3.zip</row> <row>http://example-outlink.org/3.html</row> + <row>http://example.org/path/file3.zip</row> <row>http://example-outlink.org/2.html</row> + <row>http://example.org/path/file2.zip</row> + <row>http://example-outlink.org/7.html</row> + <row>http://example-outlink.org/8.html</row> <row>http://example.org/path/file4.zip</row> - <row>http://example.org/path/file5.zip</row> - <row>http://example.org/path/file8.zip</row> <row>http://example-outlink.org/6.html</row> - <row>http://example-outlink.org/7.html</row> - <row>http://example-outlink.org/5.html</row> + <row>http://example.org/path/file6.zip</row> <row>http://example-outlink.org/4.html</row> + <row>http://example-outlink.org/5.html</row> + <row>http://example.org/path/file8.zip</row> <row>http://example.org/path/file7.zip</row> - <row>http://example-outlink.org/8.html</row> - <row>http://example.org/path/file6.zip</row> + <row>http://example.org/path/file5.zip</row> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__VisitsSummary.get_range.xml index 7ace3fcbe7..eb20b7dcf9 100644 --- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__VisitsSummary.get_range.xml +++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionUrl__VisitsSummary.get_range.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8" ?> <result> - <nb_visits>18</nb_visits> - <nb_actions>18</nb_actions> - <nb_visits_converted>18</nb_visits_converted> - <bounce_count>18</bounce_count> - <sum_visit_length>0</sum_visit_length> - <max_actions>1</max_actions> - <bounce_rate>100%</bounce_rate> - <nb_actions_per_visit>1</nb_actions_per_visit> - <avg_time_on_site>0</avg_time_on_site> + <nb_visits>17</nb_visits> + <nb_actions>77</nb_actions> + <nb_visits_converted>17</nb_visits_converted> + <bounce_count>0</bounce_count> + <sum_visit_length>27557</sum_visit_length> + <max_actions>5</max_actions> + <bounce_rate>0%</bounce_rate> + <nb_actions_per_visit>4.5</nb_actions_per_visit> + <avg_time_on_site>1621</avg_time_on_site> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventUrl__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventUrl__API.getSuggestedValuesForSegment.xml new file mode 100644 index 0000000000..60d14d644c --- /dev/null +++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventUrl__API.getSuggestedValuesForSegment.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row>http://piwik.net/space/quest/iv</row> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventUrl__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventUrl__VisitsSummary.get_range.xml new file mode 100644 index 0000000000..eb20b7dcf9 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventUrl__VisitsSummary.get_range.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_visits>17</nb_visits> + <nb_actions>77</nb_actions> + <nb_visits_converted>17</nb_visits_converted> + <bounce_count>0</bounce_count> + <sum_visit_length>27557</sum_visit_length> + <max_actions>5</max_actions> + <bounce_rate>0%</bounce_rate> + <nb_actions_per_visit>4.5</nb_actions_per_visit> + <avg_time_on_site>1621</avg_time_on_site> +</result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml index d72a0e6802..fee1d0ac41 100644 --- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml +++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml @@ -460,6 +460,7 @@ <row>pageUrl</row> <row>downloadUrl</row> <row>outlinkUrl</row> + <row>eventUrl</row> </unionOfSegments> </row> <row> @@ -578,6 +579,13 @@ </row> <row> <type>dimension</type> + <category>Events</category> + <name>Event URL</name> + <segment>eventUrl</segment> + <acceptedValues>The URL must be URL encoded, for example: http%3A%2F%2Fexample.com%2Fpath%2Fpage%3Fquery</acceptedValues> + </row> + <row> + <type>dimension</type> <category>Referrers</category> <name>Keyword</name> <segment>referrerKeyword</segment> |