Skip to content

Commit c4fc2d3

Browse files
committed
add button message instrumentation
1 parent b1c12ec commit c4fc2d3

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

Diff for: src/zoid/buttons/component.jsx

+32-14
Original file line numberDiff line numberDiff line change
@@ -686,20 +686,29 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
686686
type: "function",
687687
required: false,
688688
value: ({ props }) => {
689-
return async ({ offerType, messageType }) => {
689+
return async ({
690+
offerType,
691+
messageType,
692+
offerCountryCode,
693+
creditProductIdentifier,
694+
}) => {
690695
const { message, buttonSessionID } = props;
691696
const amount = message?.amount || undefined;
692697

693698
getLogger()
694699
.info("button_message_render")
695700
.track({
696701
[FPTI_KEY.EVENT_NAME]: "message_render",
697-
// [FPTI_KEY.BUTTON_MESSAGE_OFFER_TYPE]: offerType,
698-
// [FPTI_KEY.BUTTON_MESSAGE_TYPE]: messageType,
699-
// [FPTI_KEY.BUTTON_MESSAGE_POSITION]: message.position,
700-
// [FPTI_KEY.BUTTON_MESSAGE_ALIGN]: message.align,
701-
// [FPTI_KEY.BUTTON_MESSAGE_COLOR]: message.color,
702-
// [FPTI_KEY.AMOUNT]: amount,
702+
// adding temp string here for our sdk constants
703+
button_message_offer_type: offerType,
704+
button_message_credit_product_identifier:
705+
creditProductIdentifier,
706+
button_message_type: messageType,
707+
button_message_posiiton: message.position,
708+
button_message_align: message.align,
709+
button_message_color: message.color,
710+
button_message_offer_country: offerCountryCode,
711+
[FPTI_KEY.AMOUNT]: amount,
703712
[FPTI_KEY.BUTTON_SESSION_UID]: buttonSessionID,
704713
});
705714
};
@@ -722,7 +731,12 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
722731
type: "function",
723732
required: false,
724733
value: ({ props }) => {
725-
return async ({ offerType, messageType }) => {
734+
return async ({
735+
offerType,
736+
messageType,
737+
offerCountryCode,
738+
creditProductIdentifier,
739+
}) => {
726740
const { message, clientID, merchantID, currency, buttonSessionID } =
727741
props;
728742
const amount = message?.amount || undefined;
@@ -738,12 +752,16 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
738752
.info("button_message_clicked")
739753
.track({
740754
[FPTI_KEY.EVENT_NAME]: "message_click",
741-
// [FPTI_KEY.BUTTON_MESSAGE_OFFER_TYPE]: offerType,
742-
// [FPTI_KEY.BUTTON_MESSAGE_TYPE]: messageType,
743-
// [FPTI_KEY.BUTTON_MESSAGE_POSITION]: message.position,
744-
// [FPTI_KEY.BUTTON_MESSAGE_ALIGN]: message.align,
745-
// [FPTI_KEY.BUTTON_MESSAGE_COLOR]: message.color,
746-
// [FPTI_KEY.AMOUNT]: amount,
755+
// adding temp string here for our sdk constants
756+
button_message_offer_type: offerType,
757+
button_message_credit_product_identifier:
758+
creditProductIdentifier,
759+
button_message_type: messageType,
760+
button_message_posiiton: message.position,
761+
button_message_align: message.align,
762+
button_message_color: message.color,
763+
button_message_offer_country: offerCountryCode,
764+
[FPTI_KEY.AMOUNT]: amount,
747765
[FPTI_KEY.BUTTON_SESSION_UID]: buttonSessionID,
748766
});
749767
};

0 commit comments

Comments
 (0)