This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 2.0.0
Tracking library using Segment's HTTP API directly
version 2.0.1
license ISC
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 2.0.1
Committed At 2018-03-02 15:39:56 UTC
truqu/elm-base64 2.0.0 <= v < 3.0.0 2.0.4
krisajenkins/remotedata 4.3.1 <= v < 5.0.0 4.5.0
elm-lang/http 1.0.0 <= v < 2.0.0 1.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

Segment-elm

Library to simplify calls to segment.io

Create identify command

let
    eventData =
        let
            traits =
                [ ( "email", Json.Encode.string "pgibbons@initech.com" )
                , ( "name", Json.Encode.string "Peter Gibbons" )
                ]
        in
        { msg = UpdateIdentifyReqStateMsg
        , key = "segmentKey"
        , applicationName = "myApplicationName"
        , traits = traits
        , userId = "1234"
        }
in
Segment.createIdentifyCmd eventData

Create page command

let
    eventData =
        let
            properties =
                [ ( "title", Json.Encode.string "Welcome | Initech" )
                , ( "url", Json.Encode.string "http://www.initech.com" )
                ]
        in
        { msg = UpdatePageEventReqState
        , key = "segmentKey"
        , applicationName = "myApplicationName"
        , name = "Home"
        , properties = properties
        , userId = "1234"
        , anonymous = False
        }
in
Segment.createPageEventCmd eventData

Create track command

let
    eventData =
        let
            properties =
                [ ( "plan", Json.Encode.string "Pro Annual" )
                , ( "accountType", Json.Encode.string "Facebook" )
                ]
        in
        { msg = UpdateTrackEventReqState
        , key = "segmentKey"
        , applicationName = "myApplicationName"
        , name = "Registered"
        , properties = properties
        , userId = "someAnonymousId"
        , anonymous = True
        }
in
Segment.createTrackEventCmd eventData