Skip to content

Reduce snowplow delay before unloading a page

What does this MR do?

Reduce snowplow delay before unloading a page

Related to #267345 (closed)

Manual testing

  1. Enable a gitlab.com environment
# lib/gitlab.rb
  def self.com?
    # Check `gl_subdomain?` as well to keep parity with gitlab.com
    true 
  end

And enable screenshot-2020-10-20-16-44-34

  1. Enable additional snowplow tracking

Feature.enable(:additional_snowplow_tracking)

  1. Enable Snowplow on your local GDK

screenshot-2020-10-20-16-42-25

  1. Use the "Snowplow analytics Debugger" chrome extension to check a self-describing link-click event

screenshot-2020-10-20-16-43-47

Background

It turns out linkclicking and formtracking are enabled by using a a feature flag called :additional_snowplow_tracking) to gitlab.com

  • Snowplow JS library uses the localstorage for queueing. So if you go away from https://gitlab.com by clicking on link A, an event is registered in localstorage queue. If you come back again to any page on gitlab.com, the queue is processed and all pending events are sent back.

  • Also, if outgoing links open on a new tab/window, they are already sent automatically on the source page.

  • We digest the feedback from PMs.

  • We reduce the pageUnloadTimer to 10 milliseconds as a first iteration, in order not to lose any data

  • We may move active pages ( for example, contact sales experiment etc cc @dreedy / @s_awezec ), to open links in a new tab to guarantee timely registration of events.

  • We also rely on queuing logic

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Alper Akgun

Merge request reports