-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import mongoose, { Document, Schema } from "mongoose"; | ||
|
||
interface Analytics extends Document { | ||
journeyId: string; | ||
frameId: string; | ||
fid: string; | ||
buttonClicked: number; | ||
inputtedText: string; | ||
timestamp: Date; | ||
} | ||
|
||
const AnalyticsSchema: Schema<Analytics> = new Schema<Analytics>( | ||
{ | ||
journeyId: String, // journeyId to correlate | ||
frameId: String, //frameId to correlate | ||
fid: String, // fid of the user | ||
buttonClicked: Number, // 0 for no button clicked, 1 for button 1 clicked.... | ||
inputtedText: String, // text inputted by the user, null if empty | ||
timestamp: Number, // timestamp of the event | ||
}, | ||
{ | ||
timestamps: true, | ||
}, | ||
); | ||
|
||
// Define and export the Analytics model | ||
const Analytics = mongoose.models.Analytics || mongoose.model<Analytics>("Analytics", AnalyticsSchema); | ||
|
||
export default Analytics; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters