Skip to content

Add link clicks count to schema

Robert Hunt requested to merge add-click-events-count into main

What does this MR do and why?

This MR adds the ability for us to query for data provided by the Link Click Tracking browser SDK plugin.

This results in the visualization designer being able to create visualizations for link click events. The existing click events measure hasn't worked since the Jitsu → Snowplow switchover.

Screenshots or screen recordings

image

How to set up and validate locally

Setting up

  1. Pull this branch and restart your local Cube docker container.
  2. Generate some link click events (you can use the browser SDK to do this).

Testing Cube playground

  1. Visit your Cube playground: http://localhost:4000/
  2. Run the query:
{
      "measures": [
        "TrackedEvents.linkClicksCount"
      ],
      "dimensions": [
        "TrackedEvents.targetUrl",
        "TrackedEvents.elementId"
      ],
      "filters": [
        {
          "member": "TrackedEvents.eventName",
          "operator": "equals",
          "values": [
            "link_click"
          ]
        }
      ],
      "limit": 100,
      "timezone": "UTC",
      "timeDimensions": []
    }
  1. Validate that it returns the expected data. See gitlab-org/gitlab#414896 (comment 1583485099) as to why we have to add a filter to the query.

(Bonus) Test GitLab repo

  1. Use the branch from Fix "Click Events" measure has it has no corres... (gitlab-org/gitlab!133108 - merged).
  2. Make sure your local GitLab repo is running with a GitLab Ultimate licence.
  3. Follow these instructions to set up Product Analytics in your GDK.
  4. Visit the visualization designer, e.g. http://gdk.test:3000/gitlab-org/gitlab-test/-/analytics/dashboards/visualization-designer.
  5. Select the “Link Click Events” → “All Click Events” measure.
  6. Confirm a visualization appears and that you can select the drill-down dimensions “Target ID” and “Element ID”.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Robert Hunt

Merge request reports