-
Notifications
You must be signed in to change notification settings - Fork 200
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
Implement user_id and pass it in marketo submission #14440
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14440 +/- ##
==========================================
+ Coverage 69.58% 69.64% +0.05%
==========================================
Files 120 120
Lines 3419 3419
Branches 1178 1174 -4
==========================================
+ Hits 2379 2381 +2
+ Misses 1015 1013 -2
Partials 25 25 |
Hi team! I could not catch user_id in Marketo after testing. Here are the results: |
Thanks @eabashidze , I've pushed a fix for the cookie only being set after refresh, but I'm still trying to figure out why the id isn't being submitted even though I've added it to the enrichment payload. Will ping you once I have a fix |
Hi @mtruj013 @laszlokajtar , |
@mtruj013 @eabashidze thanks a lot for figuring it out! |
@mtruj013 @eabashidze i've had multiple sessions now where user_id wasn't generated for me. is this an exception? |
@mtruj013 @eabashidze also, in a new incognito session, while the user_id was in the cookies, it disappears or doesn't get pushed into the dataLayer on page reload for me |
If the user has not set their cookie preference, wait for the cookie policy to run first. | ||
*/ | ||
|
||
import { v4 as uuidv4 } from "https://jspm.dev/uuid"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to install and import uuidv4
npm package instead. This import looks a bit unusual to me. Is it written somewhere that this is the way it should be done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't be available client side without a bundler, so I've used a cdn as suggested here
document.cookie.match(new RegExp("(^| )" + targetCookie + "=([^;]+)")); | ||
let cookieAcceptanceValue = getCookie("_cookies_accepted"); | ||
|
||
if (cookieAcceptanceValue === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the value is None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of that cookie when not set is null
, but updated to catch more falsey values
@laszlokajtar I fixed the |
Done
QA
document.cookie
and see thatuser_id
does not existuser_id
is now presentGoogle Analytics User ID
has you user id as a value:Issue / Card
Fixes https://warthogs.atlassian.net/browse/WD-14942