Skip to content

[engine] Boost CPC minds#3819

Ben requested to merge feat/click-tracking-m3819 into master

Ticket(s) / Related Merge Requests

Summary of Changes

Tracking clicks for Boost CPC metrics that we can next display in users Boost consoles.

Testing Considerations

You need to find a boost with a rich embed, click it and make sure a request goes out to the analytics endpoint for clicks, either ON the video preview, in the information field OR in the actual post body link. I have also added the same behavior to comments and non-Boosts though nothing is actually listening to them yet other than Snowplow.

Try a variety of embed types - if any aren't working properly test against production and sandbox to verify whether the issue is with this sandbox, as there are various known issues with some rich embeds. Note as per request, ALL embeds are now previews only until clicked - YouTube SHOULD autoplay after clicking the preview (and send off to the analytics endpoint)- if you look at prod on mobile, it is currently just loading iframes - we have changed this here at @markharding's request. Note also as per discussions with @markryansallee that a single click on the youtube player (preview in this case) should register a click and subsequent ones should not without refresh - it is fine if multiple clicks on a link in the post body do trigger multiple clicks.

You should check that the matching Boost in Vitess has its "clicks" value incremented every click.

Make sure you have the event stream running in the pod via:

!DO NOT CLOSE YOUR TERMINAL AND LEAVE THIS PROCESS RUNNING - IF YOU ACCIDENTALLY DO, DM ME.!

# in the pods engine dir run
source /vault/secrets/env &&  php /var/www/Minds/engine/cli.php EventStreams --subscription=Core\\Boost\\V3\\EventStreams\\BoostClickStreamsSubscription

!DO NOT CLOSE YOUR TERMINAL AND LEAVE THIS PROCESS RUNNING - IF YOU ACCIDENTALLY DO, DM ME.!

You can monitor that the clicks to update then via watching Vitess. I use tableplus and proxy it through locally via:

kubectl port-forward -n vitess svc/minds-vtgate 3307:3306

Finally note that changes have been made to client meta for various actions as outlined in regression scope.

If whoever QAs needs help DM me - appreciate this one is a little in depth because there are not yet any user facing metrics that can be checked.

Deployment Considerations

Update Vitess with:

ALTER TABLE boost_summaries
    ADD clicks int
    AFTER views;

Make sure that the runner from helm MR is running - should presumably be somewhat automatic via ArgoCD.

Regression Scope

  • Rich embeds.
  • Click behavior on rich embeds, web and mobile-web.
  • Adding data to Snowplow for various events like thumbs, remind, boost feed, boost click etc
  • Boost summaries

Platform Affected (web, mobile, etc)

Web

Developer Testing Completed

Engine Unit (phpspec), Angular Unit (karma/jasmine), manual.

Screenshots / Screen Recording

Normal Embed

simplescreenrecorder-2023-03-21_10.58.57

YT

simplescreenrecorder-2023-03-21_11.08.03

Does this impact

  • Localization
  • Dark/light mode
  • Guest mode

Definition of Done Checklist

  • The Acceptance Criteria has been met
  • Code is tested: Testing includes unit/spec, E2E/automated and manual testing
  • Merge requests description has been filled out
Edited by Ben

Merge request reports