-
Notifications
You must be signed in to change notification settings - Fork 330
[WV 1097] Add dataLayer push for Share button on Ballot Page [FEEDBACK PROVIDED] #4381
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
base: develop
Are you sure you want to change the base?
[WV 1097] Add dataLayer push for Share button on Ballot Page [FEEDBACK PROVIDED] #4381
Conversation
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.
This is a great start @aayushi01shah. Comments below. Can you also be prepared to demo this in today's meeting?
@@ -52,6 +54,42 @@ class ShareButtonDesktopTablet extends Component { | |||
const googleCivicElectionId = 0; | |||
let kindOfShare = 'BALLOT'; | |||
let whatAndHowMuchToShare; | |||
|
|||
// Add debug logging | |||
console.log('Share button clicked'); |
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.
Hi @aayushi01shah I think this block should go after line 107 after kindOfShare and whatAndHowMuchToShare have been calculated. For the destinationDetails, we should use pathnameWithModalShare for the destinationPathname.
I would also recommend adding all of the various pathnameWithModalShare
paths into lookupPageNameAndPageTypeDict so we can specify the destinationPageName and destinationPageType there.
voterWeVoteId: VoterStore.getVoterWeVoteId(), | ||
}, | ||
shareDetails: { | ||
kindOfShare, |
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 good to also capture whatAndHowMuchToShare in this shareDetails dictionary.
const page = lookupPageNameAndPageTypeDict(currentPathname); | ||
|
||
const dataLayerObject = { | ||
event: 'shareClick', |
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.
event should be 'action'. Please also add actionDetails, which would include the id of the button clicked ("shareButtonDesktopTablet") -- BUT I think we should adjust this id to include the kind of share (ex/ candidateShare, officeShare, etc.):
actionDetails: {
actionType: 'openModal',
buttonId: <ADD BUTTON ID HERE>,
},
965ff12
to
909cf80
Compare
[WV 1097] Add dataLayer for "Share" on Ballot Page
This implementation adds Google Tag Manager dataLayer tracking for share button clicks across different sharing contexts (ballot, candidate, measure, office, organization, etc.)