Peacemaker.UserProfile (Peacemaker v3.3.5-rc.7) View Source

This module is responsible for creating unique user ids that will be used as the user_id for all calls made to Segment. In other words, the tracking_id is also the user_id that is being sent to Google Analytics.

With every Account or Optin we create, we also create a %Peacemaker.UserProfile{} record. The tracking_id is meant to be a value returned from Ecto.UUID.generate/1

Link to this section Summary

Link to this section Types

Specs

t() :: %{
  tracking_id: String.t(),
  account: Peacemaker.Account.t(),
  optin: Peacemaker.Optin.t()
}

Link to this section Functions

Link to this function

changeset(struct, attrs)

View Source
Link to this function

find_account_or_optin(email)

View Source

Specs

find_tracking_id(String.t()) :: String.t() | {:error, String.t()}

Finds a tracking id by the given email.

Link to this function

find_user_profile(email)

View Source
Link to this function

update_profile(email, payload)

View Source
Link to this function

update_user_type(changeset, payload, current_user_type)

View Source