episphere / connect

Connect API for DCEG's Cohort Study
10 stars 5 forks source link

Sendgrid Click Tracking (September) #914

Open sonyekere opened 4 months ago

sonyekere commented 4 months ago

Request turn on functionality for Sendgrid Click tracking.

brotzmanmj commented 4 months ago

@jhflorey @HanaShiho Are we ok to turn this on? We have not yet had any issues reported to us by recruits/participants about the magic link since we made that live on Friday.

jhflorey commented 4 months ago

I have tried in stage of PWA. The steps as as follows

  1. Use Twilio to send the sms that inclue the link https://myconnect-stage.cancer.gov/?clicktracking=twilio
  2. Click on the link to open it in my device's browser
  3. The next day, go to Google Analytic 4 to find the report as the image below

image

From the result above, for click tracking for all scenarios such as (Twilio, Sendgrid, etc.) i beleive we can do the same way to monitor in Google Analytics 4. We only add the query to the link. The query is whatever It depends on the pattern we want.

Example

brotzmanmj commented 4 months ago

@depietrodeanna I don't know much about this. Can you comment? thanks

jhflorey commented 4 months ago

It works now on GA4. I have a demo meeting with Hana after her PTO, if team need demo earlier, I can reschedule the meeting. Pls let me know. Thx

depietrodeanna commented 4 months ago

@jhflorey stepping in while Hana is out. Just to confirm, click tracking for Twilio is specific to our SMS messages, and click tracking in SendGrid is specific to our emails, correct? Also, can we customize the text of the click tracking link? Lastly, please confirm whether this is turned on in stage (I wasn't sure if you could turn on click tracking in just stage and not across all the tiers). Thanks!

jhflorey commented 4 months ago

it works on all environments

depietrodeanna commented 4 months ago

@jhflorey please set up a short demo with me before Hana is back.

brotzmanmj commented 4 months ago

@depietrodeanna yes you are correct, click tracking in Twilio is for SMS and click tracking for SendGrid is for email. About the links, Davin, Hana, and others(?) met with the Twilio rep recently and they said there was Twilio Link Shortening capabilities we could use (they are already part of what we are paying for) in order to customize links and not have them consume a lot of characters in our messages. Is this something you can look into?

depietrodeanna commented 4 months ago

@brotzmanmj yes I recall the link shortening conversation; we recorded that Twilio was going to send us some more info about this after we met with them last week..we (at least I) have not received anything but I will check in with our rep! @jhflorey let me know if you have any other details post-our convo with Twilio that I'm not privy to.

depietrodeanna commented 4 months ago

Met with @jhflorey to review Google Analytics click tracking. To track clicks, we just need to include /? at the end of "myconnect.cancer.gov" and can include anything we want after the ? to make the link click-trackable. To differentiate between reminders and contact attempts, between both SMS and email, we'd want the last bit of the URL to be unique and connect easily to all of our emails/contact attempts. We should define a structure for this and a place to record such information (the notification specs spreadsheet makes sense for each individual reminder schema but I think we also need a place where the trackable links are compiled).

This is ready for stage testing- can start with PROMIS reminders and come up with conventions for tracking SMS and email clicks. Data for clicks takes 24 hours to become available in Google Analytics.

brotzmanmj commented 4 months ago

Thanks @depietrodeanna and @jhflorey . I defer to you @depietrodeanna as you what links you want to track and what convention you want to use. To function properly does it need to be unique to every message we sent or just in buckets (e.g. survey reminders, newsletters, biospecimen reminder)?

mnataraj92 commented 4 months ago

Hi all, here is the link to the DD: https://github.com/Analyticsphere/ConnectMasterAndSurveyCombinedDataDictionary/blob/main/MasterSurveyComb_20220317.xlsx

The variables that we already have in the DD for SendGrid tracking are from rows 1903 (CTSG_DeliveredStatus_v1r0) to 1921 (CTSG_UnsubDTv1r0). All SendGrid variables have a secondary source (column F) of SendGrid and start with "CTSG".

depietrodeanna commented 4 months ago

@brotzmanmj We have the flexibility to set the click tracking up however we want; it can be as unique or general as we need. To track in individual emails (contact # and email category), we'd need the link to be unique for each specific email. If we just want to track "post verification survey reminders" as a whole (not differentiate between contact attempts, then we'd just use one link (this wouldn't give us much info since I think the most important piece is understanding the effectiveness of each contact attempt). To differentiate between click tracking data among different email categories (biospecimen donation reminders, biosurvey reminders, PROMIS reminders, etc.) we'd need a different link for each, and within each category a unique link to distinguish reminder 1 from reminder 2, and so forth. So basically every email would need a unique link.

jhflorey commented 3 months ago

@depietrodeanna @HanaShiho i've already enabled click tracking in the sendgrid.

sonyekere commented 3 months ago

Sendgrid error found when clicking link, functionality has been turned off. DevOps to connect with CBIIT on 'link branding'