mixpanelUpdateProfile: Update Mixpanel Profile

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/mixpanelUpdateProfile.R

Description

Update Mixpanel profiles (also called 'users' or 'people') using the Mixpanel Engage API.

Usage

1
2
mixpanelUpdateProfile(account, distinctID, data, 
	updateLastSeen=FALSE, updateLocation=FALSE, retryCount=100)

Arguments

account

A mixpanel account, as defined in mixpanelCreateAccount.

distinctID

A distinct ID, identifying the profile. Could be extracted by calling mixpanelGetProfiles

data

JSON dictionary with property names and values. See Mixpanel documentation or example below.

updateLastSeen

If true, Mixpanel will update the Last Seen property. Default is false

updateLocation

If false, Mixpanel will not update the IP address of the profile. Default is false

retryCount

Applied if the HTTP request fails.

Value

None.

Author(s)

Meinhard Ploner

References

https://mixpanel.com/help/reference/http#people-analytics-updates

See Also

mixpanelGetProfiles

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
## Fill in here the API token, key and secret as found on 
## www.mixpanel.com - Account -> Projects. 
account = mixpanelCreateAccount("ProjectName",
                                token="c12g3...",
                                secret="168e7e...", 
                                key="543c55...")
                                
mixpanelUpdateProfile(
  account, 
  "11b9c243-4ea3...",  
  data=list( 
    "$set"=list(day=jsonlite::unbox(12), 
                month=jsonlite::unbox(3), 
                "$name"=jsonlite::unbox("Dummy name")),
    "$setOnce"=list(installYear=2016),
    "$unset"=c("oldProp1", "oldProp2"),
    "$union"=list(month=10:12)
    ## "$delete": ""    ## !!! Delete user. !!!
  )
)

## End(Not run)

RMixpanel documentation built on May 1, 2019, 10:46 p.m.