Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The value "IMMEDIATELY_PRECEDES" of matchType argument is always changing to "PRECEDES" #180

Closed
digitos opened this issue Jun 18, 2018 · 1 comment
Assignees
Labels

Comments

@digitos
Copy link

digitos commented Jun 18, 2018

What goes wrong

An argument of the segment_element() function doesn't work correctly:

The value "IMMEDIATELY_PRECEDES" of matchType argument is always changing to "PRECEDES"

Segment Builder has the same problem.

Steps to reproduce the problem

There is, for example, a sequence of steps:

step1 <- segment_element("pagePath", 
                         operator = "REGEXP", 
                         type = "DIMENSION", 
                         expressions = "^/step-1",
                         matchType = "IMMEDIATELY_PRECEDES")

step2 <- segment_element("eventCategory", 
                         operator = "EXACT", 
                         type = "DIMENSION", 
                         expressions = "Call to action",
                         matchType = "IMMEDIATELY_PRECEDES")

step3 <- segment_element("pagePath", 
                         operator = "REGEXP", 
                         type = "DIMENSION", 
                         expressions = "^/success",
                         matchType = "IMMEDIATELY_PRECEDES")

sv_sequence <- segment_vector_sequence(list(list(step1),list(step2),list(step3)))
seq_defined <- segment_define(list(sv_sequence))
segment4_seq <- segment_ga4("sequence", user_segment = seq_defined)

Expected output

> segment4_seq[[1]][["dynamicSegment"]][["userSegment"]][["segmentFilters"]][[1]][["sequenceSegment"]][["segmentSequenceSteps"]][[1]][["matchType"]]
[1] "IMMEDIATELY_PRECEDES"
> segment4_seq[[1]][["dynamicSegment"]][["userSegment"]][["segmentFilters"]][[1]][["sequenceSegment"]][["segmentSequenceSteps"]][[2]][["matchType"]]
[1] "IMMEDIATELY_PRECEDES"
> segment4_seq[[1]][["dynamicSegment"]][["userSegment"]][["segmentFilters"]][[1]][["sequenceSegment"]][["segmentSequenceSteps"]][[3]][["matchType"]]
[1] "IMMEDIATELY_PRECEDES"

Actual output

> segment4_seq[[1]][["dynamicSegment"]][["userSegment"]][["segmentFilters"]][[1]][["sequenceSegment"]][["segmentSequenceSteps"]][[1]][["matchType"]]
[1] "PRECEDES"
> segment4_seq[[1]][["dynamicSegment"]][["userSegment"]][["segmentFilters"]][[1]][["sequenceSegment"]][["segmentSequenceSteps"]][[2]][["matchType"]]
[1] "PRECEDES"
> segment4_seq[[1]][["dynamicSegment"]][["userSegment"]][["segmentFilters"]][[1]][["sequenceSegment"]][["segmentSequenceSteps"]][[3]][["matchType"]]
[1] "PRECEDES"

Session Info

R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reshape2_1.4.3         ggplot2_2.2.1          dplyr_0.7.5            googleAnalyticsR_0.5.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17      bindr_0.1.1       magrittr_1.5      munsell_0.5.0     tidyselect_0.2.4  colorspace_1.3-2 
 [7] R6_2.2.2          rlang_0.2.1       stringr_1.3.1     plyr_1.8.4        httr_1.3.1        tools_3.5.0      
[13] grid_3.5.0        gtable_0.2.0      googleAuthR_0.6.2 openssl_1.0.1     lazyeval_0.2.1    yaml_2.1.19      
[19] assertthat_0.2.0  digest_0.6.15     tibble_1.4.2      bindrcpp_0.2.2    purrr_0.2.5       tidyr_0.8.1      
[25] curl_3.2          memoise_1.1.0     glue_1.2.0        stringi_1.2.3     compiler_3.5.0    pillar_1.2.3     
[31] scales_0.5.0      jsonlite_1.5      pkgconfig_2.0.1 
@MarkEdmondson1234
Copy link
Collaborator

Thanks very much for this @digitos - your reproduceable example let me find the bug easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants