Skip to content

Commit

Permalink
abテストタグいらな
Browse files Browse the repository at this point in the history
  • Loading branch information
eatski committed Mar 24, 2024
1 parent 438f0c5 commit 1f391d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
10 changes: 1 addition & 9 deletions src/common/util/gtag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const gtagEvent = async (
name: string,
options?: {
data?: Record<string, string | number>;
enableAbTesting?: boolean;
},
) => {
try {
Expand All @@ -25,14 +24,7 @@ export const gtagEvent = async (
if (process.env.NODE_ENV === "production") {
// @ts-ignore
window.gtag("event", name, mergedData);
// @ts-ignore
options?.enableAbTesting &&
// @ts-ignore
window.gtag(
"event",
`abtesting_${mergedData.global_abtesting}_${name}`,
mergedData,
);
å;
} else {
console.log("gtag", name, mergedData);
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/play/components/answerResult/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ export const AnswerResult: React.FC<Props> = ({
<Button
type={"button"}
onClick={() => {
gtagEvent("like_story", {
enableAbTesting: true,
});
gtagEvent("like_story");
toast("いいねしました!");
}}
color="none"
Expand Down
4 changes: 1 addition & 3 deletions src/components/play/components/questionForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export const QuestionForm: React.FC<{
onSubmit={(e) => {
e.preventDefault();
if (e.target instanceof HTMLFormElement && e.target.checkValidity()) {
gtagEvent("click_submit_question", {
enableAbTesting: true,
});
gtagEvent("click_submit_question");
onSubmit(inputValue);
setInputValue(""); // reset form input after submission
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/play/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ const AnswerFormContainer: React.FC<{
const modalConfrim = useConfirmModal<boolean>();
const onSubmit = useCallback(
async (input: string) => {
gtagEvent("click_submit_answer", {
enableAbTesting: true,
});
gtagEvent("click_submit_answer");
mutate({
storyId: story.id,
text: input,
Expand Down

0 comments on commit 1f391d9

Please sign in to comment.