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

[Continued] Google Analytics import #1753

Merged
merged 148 commits into from
Mar 10, 2022
Merged

[Continued] Google Analytics import #1753

merged 148 commits into from
Mar 10, 2022

Commits on Feb 26, 2022

  1. Configuration menu
    Copy the full SHA
    aac8620 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9bae8c7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    167f31a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1855942 View commit details
    Browse the repository at this point in the history
  5. Add imported_visitors table

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    9abe8d3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    25061f2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5a292ca View commit details
    Browse the repository at this point in the history
  8. Pass another dataset to main graph for rendering in red

    This adds another entry to the JSON data returned via the main graph API
    called `imported_plot`, which is similar to `plot` in form but will be
    completed with previously imported data.  Currently it simply returns
    the values from `plot` / 2. The data is rendered in the main graph in
    red without fill, and without an indicator for the present. Rationale:
    imported data will not continue to grow so there is no projection
    forward, only backwards.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    56a5b5e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e0ca9bb View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    bffb113 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    54703d2 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b5b5cec View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e6ab270 View commit details
    Browse the repository at this point in the history
  14. Start converting metrics to atoms so they can be subqueried

    This changes "visitors" and in some places "sources" to atoms. This does
    not change the behaviour of the functions - the tests all pass unchanged
    following this commit. This is necessary as joining subqueries requires
    that the keys in `select` statements be atoms and not strings.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    0c5c4b7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    9e1b46d View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    a2c37fb View commit details
    Browse the repository at this point in the history
  17. format

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    be412a3 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    afe3535 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    9ea2cd3 View commit details
    Browse the repository at this point in the history
  20. Fix some mistakes in tables

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    f5b8f95 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    dd0462e View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    2b86326 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    8a969ea View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    5b09c8c View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    e2c185a View commit details
    Browse the repository at this point in the history
  26. Also add tentative imported_utm_sources table

    This needs a bit more work on the google import side, as GA do not
    report sources and utm sources as distinct things.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    0a62a4d View commit details
    Browse the repository at this point in the history
  27. Return imported data to dashboard for rest of Sources panel

    This extends the merge_imported function definition for sources to
    utm_sources, utm_mediums and utm_campaigns too. This appears to be
    working on the DB side but something is incomplete on the client side.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    5a0a81d View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    fa65a50 View commit details
    Browse the repository at this point in the history
  29. Merge entry pages and exit pages from imported data into unfiltered d…

    …ashboard view
    
    This requires converting the `"visits"` and `"visit_duration"` metrics
    to atoms so that they can be used in ecto subqueries.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    a8b0b10 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    b8ee7df View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    0e57d58 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    aac954d View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    f2d7eab View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    3ab7d57 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    87ba204 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    c5bc70a View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    7936e6f View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    bca7e24 View commit details
    Browse the repository at this point in the history
  39. Get timeOnPage and pageviews for pages from GA

    These are needed for the pages modal, and for calculating exit rates for
    exit pages.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    3f38a3e View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    a03759e View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    b8b8ccf View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    991cf88 View commit details
    Browse the repository at this point in the history
  43. Drop imported browser and OS versions

    These are not needed.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    e03e128 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    5dbde9e View commit details
    Browse the repository at this point in the history
  45. Parse referrers with RefInspector

    - Use 'ga:fullReferrer' instead of 'ga:source'. This provides the actual
      referrer host + path, whereas 'ga:source' includes utm_mediums and
      other values when relevant.
    - 'ga:fullReferror' does however include search engine names directly,
      so they are manually checked for as RefInspector won't pick up on
      these.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    71abc96 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    4bfee86 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    5ff0412 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    2c6255e View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    543f42b View commit details
    Browse the repository at this point in the history
  50. mix format

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    21fcada View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    a7da346 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    6ca72a2 View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    93ddbab View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    67fd47a View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    2158098 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    8083261 View commit details
    Browse the repository at this point in the history
  57. mix format

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    2881946 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    d3d9a5c View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    46fb187 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    e95e92b View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    e78c2e5 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    9e3963a View commit details
    Browse the repository at this point in the history
  63. Reformat top graph side icons

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    429ec25 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    393ad27 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    d446486 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    adb3f22 View commit details
    Browse the repository at this point in the history
  67. Fix existing tests

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    f737aa7 View commit details
    Browse the repository at this point in the history
  68. fix tests

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    c6b314f View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    ae84c7e View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    ecfccd4 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    c48b3b5 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    bb6b085 View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    866097e View commit details
    Browse the repository at this point in the history
  74. Configuration menu
    Copy the full SHA
    98f27f0 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    ca5f1e5 View commit details
    Browse the repository at this point in the history
  76. Clean locations import from Google Analytics

    - Country and region should be set to "" when GA provides "(not set)"
    - City should be set to 0 for "unknown", as we cannot reliably import
      city data from GA.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    944d07a View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    c14ded5 View commit details
    Browse the repository at this point in the history
  78. os -> operating_system in some parts of code

    The inconsistency of using os in some places and operating_system in
    others causes trouble with subqueries and joins for the native and
    imported data, which would require additional logic to account for. The
    simplest solution is the just use a consistent word for all uses. This
    doesn't make any user-facing or database changes.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    787ee44 View commit details
    Browse the repository at this point in the history
  79. to_atom -> to_existing_atom

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    e0a06f0 View commit details
    Browse the repository at this point in the history
  80. format

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    decc32f View commit details
    Browse the repository at this point in the history
  81. "events" metric -> :events

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    7a1695f View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    8f35671 View commit details
    Browse the repository at this point in the history
  83. update "bounce_rate"

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    1d85271 View commit details
    Browse the repository at this point in the history
  84. Configuration menu
    Copy the full SHA
    0c50991 View commit details
    Browse the repository at this point in the history
  85. Configuration menu
    Copy the full SHA
    afdd562 View commit details
    Browse the repository at this point in the history
  86. Configuration menu
    Copy the full SHA
    9aeca6f View commit details
    Browse the repository at this point in the history
  87. Configuration menu
    Copy the full SHA
    173df31 View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    f09a99d View commit details
    Browse the repository at this point in the history
  89. Configuration menu
    Copy the full SHA
    8acc085 View commit details
    Browse the repository at this point in the history
  90. Configuration menu
    Copy the full SHA
    95e38a4 View commit details
    Browse the repository at this point in the history
  91. "time_on_page" -> :time_on_page

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    88d925d View commit details
    Browse the repository at this point in the history
  92. Convert imported GA data to UTC

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    b337e72 View commit details
    Browse the repository at this point in the history
  93. Clean up GA request code a bit

    There was some weird logic here with two separate lists that really
    ought to be together, so this merges those.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    0e48b25 View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    11821fd View commit details
    Browse the repository at this point in the history
  95. Configuration menu
    Copy the full SHA
    ca8531b View commit details
    Browse the repository at this point in the history
  96. Configuration menu
    Copy the full SHA
    b534f62 View commit details
    Browse the repository at this point in the history
  97. Imported GA from all of time

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    a0e2167 View commit details
    Browse the repository at this point in the history
  98. Reorganise GA data fetch logic

    - Fetch data from the start of time (2005)
    - Check whether no data was fetched, and if so, inform user and don't
      consider data to be imported.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    1505e7b View commit details
    Browse the repository at this point in the history
  99. Configuration menu
    Copy the full SHA
    de3220d View commit details
    Browse the repository at this point in the history
  100. Apply location filters from API

    This makes it consistent with the sources etc which filter out 'Direct /
    None' on the API side. These filters are used by both the native and
    imported data handling code, which would otherwise both duplicate the
    filters in their `where` clauses.
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    5b57143 View commit details
    Browse the repository at this point in the history
  101. Configuration menu
    Copy the full SHA
    734a520 View commit details
    Browse the repository at this point in the history
  102. Configuration menu
    Copy the full SHA
    1a6ab5b View commit details
    Browse the repository at this point in the history
  103. Run GA import in the background

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    bbbc625 View commit details
    Browse the repository at this point in the history
  104. Configuration menu
    Copy the full SHA
    2ba78d3 View commit details
    Browse the repository at this point in the history
  105. Configuration menu
    Copy the full SHA
    8eba626 View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    680708f View commit details
    Browse the repository at this point in the history
  107. Configuration menu
    Copy the full SHA
    4cb02e5 View commit details
    Browse the repository at this point in the history
  108. Configuration menu
    Copy the full SHA
    6309562 View commit details
    Browse the repository at this point in the history
  109. Configuration menu
    Copy the full SHA
    516c84d View commit details
    Browse the repository at this point in the history
  110. Configuration menu
    Copy the full SHA
    4132f64 View commit details
    Browse the repository at this point in the history
  111. Configuration menu
    Copy the full SHA
    51ca030 View commit details
    Browse the repository at this point in the history
  112. Configuration menu
    Copy the full SHA
    2e13a60 View commit details
    Browse the repository at this point in the history
  113. Configuration menu
    Copy the full SHA
    d369ba3 View commit details
    Browse the repository at this point in the history
  114. Configuration menu
    Copy the full SHA
    16a9d01 View commit details
    Browse the repository at this point in the history
  115. Add imported data to UTM tests

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    67fba86 View commit details
    Browse the repository at this point in the history
  116. Configuration menu
    Copy the full SHA
    5ac5ba6 View commit details
    Browse the repository at this point in the history
  117. Test import of sources GA data

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    cb9ce03 View commit details
    Browse the repository at this point in the history
  118. Configuration menu
    Copy the full SHA
    de821d6 View commit details
    Browse the repository at this point in the history
  119. Configuration menu
    Copy the full SHA
    d646757 View commit details
    Browse the repository at this point in the history
  120. Add tests for UTM terms

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    cd17fe5 View commit details
    Browse the repository at this point in the history
  121. Add tests for UTM contents

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    72303d8 View commit details
    Browse the repository at this point in the history
  122. Configuration menu
    Copy the full SHA
    8b90896 View commit details
    Browse the repository at this point in the history
  123. Configuration menu
    Copy the full SHA
    380f9aa View commit details
    Browse the repository at this point in the history
  124. Fix module file name typo

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    a29a7c1 View commit details
    Browse the repository at this point in the history
  125. Configuration menu
    Copy the full SHA
    99e3c15 View commit details
    Browse the repository at this point in the history
  126. Configuration menu
    Copy the full SHA
    82e50cb View commit details
    Browse the repository at this point in the history
  127. Configuration menu
    Copy the full SHA
    f5603f9 View commit details
    Browse the repository at this point in the history
  128. Configuration menu
    Copy the full SHA
    b37e814 View commit details
    Browse the repository at this point in the history
  129. Configuration menu
    Copy the full SHA
    55da66a View commit details
    Browse the repository at this point in the history
  130. Bump clickhouse_ecto version

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    2ff7606 View commit details
    Browse the repository at this point in the history
  131. Configuration menu
    Copy the full SHA
    ba28622 View commit details
    Browse the repository at this point in the history
  132. Configuration menu
    Copy the full SHA
    df6d1bc View commit details
    Browse the repository at this point in the history
  133. Configuration menu
    Copy the full SHA
    92ffae1 View commit details
    Browse the repository at this point in the history
  134. More strings -> atoms

    Also changes a conditional to be a bit nicer
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    0e9c045 View commit details
    Browse the repository at this point in the history
  135. Configuration menu
    Copy the full SHA
    fdf4d00 View commit details
    Browse the repository at this point in the history
  136. Split sources and UTM sources from fetched GA data

    GA has only a "source" dimension and no "UTM source" dimension. Instead
    it returns these combined. The logic herein to tease these apart is:
    
    1. "(direct)" -> it's a direct source
    2. if the source is a domain -> it's a source
    3. "google" -> it's from adwords; let's make this a UTM source "adwords"
    4. else -> just a UTM source
    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    0cb66d6 View commit details
    Browse the repository at this point in the history
  137. Configuration menu
    Copy the full SHA
    175025b View commit details
    Browse the repository at this point in the history
  138. fix typo

    m-col committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    c574abe View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2022

  1. Fix import

    ukutaht committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    9213b29 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2022

  1. Configuration menu
    Copy the full SHA
    5073b39 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f99441 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2022

  1. Merge source tables

    ukutaht committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    16c8cb1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c324395 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2022

  1. Configuration menu
    Copy the full SHA
    d4b554b View commit details
    Browse the repository at this point in the history
  2. Track import progress

    ukutaht committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    8a0b532 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2022

  1. Configuration menu
    Copy the full SHA
    a7bc60f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ddbfb4 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2022

  1. Fix time on page using exits

    ukutaht committed Mar 10, 2022
    Configuration menu
    Copy the full SHA
    bd7e40b View commit details
    Browse the repository at this point in the history