Skip to content

Commit

Permalink
chore: upadte event_library and add todos
Browse files Browse the repository at this point in the history
  • Loading branch information
teslashibe committed Aug 19, 2024
1 parent 54e108d commit e484527
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/event/event_library.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
package event

import "fmt"

// TODO: Define our events properly. These are placeholders and should be replaced with actual event definitions.

func (a *EventTracker) TrackUserLogin(userID string, client *EventClient) error {
if a == nil {
return fmt.Errorf("EventTracker is nil")
}
return a.TrackAndSendEvent("user_login", map[string]interface{}{"user_id": userID}, client)
}

func (a *EventTracker) TrackPageView(pageURL string, client *EventClient) error {
if a == nil {
return fmt.Errorf("EventTracker is nil")
}
return a.TrackAndSendEvent("page_view", map[string]interface{}{"url": pageURL}, client)
}

func (a *EventTracker) TrackPurchase(productID string, amount float64, client *EventClient) error {
if a == nil {
return fmt.Errorf("EventTracker is nil")
}
return a.TrackAndSendEvent("purchase", map[string]interface{}{
"product_id": productID,
"amount": amount,
Expand Down

0 comments on commit e484527

Please sign in to comment.