Skip to content

Commit

Permalink
fix(share): fix share events
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-bex committed Aug 18, 2023
1 parent b3c4805 commit 3c0d6a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ export const CVShareButtons = ({
<StyledCVShareButtonsContainer>
<LinkedinShareButton
disabled={actionDisabled}
onClick={() => {
fbEvent(FB_TAGS.SHARE_CV_OPEN);
}}
onShareWindowClose={() => {
gaEvent(GA_TAGS.PAGE_CV_PARTAGE_CV_LINKEDIN_CLIC);
fbEvent(FB_TAGS.SHARE_CV);
fbEvent(FB_TAGS.SHARE_CV_SEND);
updateSharesCount(cv.UserId, 'linkedin');
openNewsletterModal();
}}
Expand All @@ -72,9 +75,12 @@ export const CVShareButtons = ({
</LinkedinShareButton>
<FacebookShareButton
disabled={actionDisabled}
onClick={() => {
fbEvent(FB_TAGS.SHARE_CV_OPEN);
}}
onShareWindowClose={() => {
gaEvent(GA_TAGS.PAGE_CV_PARTAGE_CV_FACEBOOK_CLIC);
fbEvent(FB_TAGS.SHARE_CV);
fbEvent(FB_TAGS.SHARE_CV_SEND);
updateSharesCount(cv.UserId, 'facebook');
openNewsletterModal();
}}
Expand All @@ -88,9 +94,12 @@ export const CVShareButtons = ({
</FacebookShareButton>
<TwitterShareButton
disabled={actionDisabled}
onClick={() => {
fbEvent(FB_TAGS.SHARE_CV_OPEN);
}}
onShareWindowClose={() => {
gaEvent(GA_TAGS.PAGE_CV_PARTAGE_CV_TWITTER_CLIC);
fbEvent(FB_TAGS.SHARE_CV);
fbEvent(FB_TAGS.SHARE_CV_SEND);
updateSharesCount(cv.UserId, 'twitter');
openNewsletterModal();
}}
Expand All @@ -105,9 +114,12 @@ export const CVShareButtons = ({
</TwitterShareButton>
<WhatsappShareButton
disabled={actionDisabled}
onClick={() => {
fbEvent(FB_TAGS.SHARE_CV_OPEN);
}}
onShareWindowClose={() => {
gaEvent(GA_TAGS.PAGE_CV_PARTAGE_CV_WHATSAPP_CLIC);
fbEvent(FB_TAGS.SHARE_CV);
fbEvent(FB_TAGS.SHARE_CV_SEND);
updateSharesCount(cv.UserId, 'whatsapp');
openNewsletterModal();
}}
Expand Down
6 changes: 3 additions & 3 deletions src/constants/tags.js → src/constants/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export const GA_TAGS = {
BACKOFFICE_CANDIDAT_HEADER_BAO_CLIC: {
action: 'Backoffice_Candidat_Header_BAO_Clic',
},
};
} as const;

export const FB_TAGS = {
CANDIDATE_REGISTRATION_OPEN: {
Expand Down Expand Up @@ -448,7 +448,7 @@ export const FB_TAGS = {
type: 'track',
action: 'Donate',
},
};
} as const;

export const LINK_TAGS = {
COMPANY_CONTACT_OPEN: {
Expand All @@ -457,4 +457,4 @@ export const LINK_TAGS = {
COMPANY_CONTACT_SEND: {
conversionId: 11224580,
},
};
} as const;

0 comments on commit 3c0d6a0

Please sign in to comment.