Skip to content

Commit

Permalink
Add anonymous invite events to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hownowstephen authored Apr 26, 2022
2 parents 7320010 + 7268be4 commit 063487d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ You can also send anonymous events representing people you haven't identified. A

```go
// Arguments
// anonymous_id (required) - an identifier representing an unknown person.
// anonymous_id (required) - nullable, an identifier representing an unknown person.
// name (required) - the name of the event you want to track.
// attributes (optional) - any related information you'd like to attach to this
// event, as a ```map[string]interface{}```.
Expand All @@ -234,6 +234,18 @@ if err := track.TrackAnonymous("anonymous_id", "invite", map[string]interface{}{
// handle error
}
```
#### Anonymous invite events

If you previously sent [invite events](https://customer.io/docs/anonymous-invite-emails/), you can achieve the same functionality by sending an anonymous event an empty string for the anonymous identifier. To send anonymous invites, your event *must* include a `recipient` attribute.

```go
if err := track.TrackAnonymous("", "invite", map[string]interface{}{
"first_name": "Alex",
"recipient": "[email protected]",
}); err != nil {
// handle error
}
```

### Adding a device to a customer

Expand Down

0 comments on commit 063487d

Please sign in to comment.