Skip to content

Social data tracking

Unlike the Braze iOS SDK, the Braze Windows SDK does not automatically collect Facebook and Twitter data. However, it’s possible to add social media data to a Braze user’s profile from the Windows SDK as well:

  • Obtain social media data within your application via the Facebook SDK and Twitter APIs.
  • Initialize Facebook and Twitter User objects with social media data and pass them to Braze.

Social network data constructors

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FacebookUser(
  string Id,
  string FirstName,
  string LastName,
  string Email,
  // mm/dd/yyyy format.
  string Birthday,
  string Bio,
  FacebookLocation LocationObject,
  // "m" or "f".
  string Gender,
  List<FacebookLike> Likes,
  int NumFriends
)

FacebookLocation(
  string CityName
)

FacebookLike(
  // The name of a page the user likes.
  string Like
)

TwitterUser(
  string Description,
  int FollowersCount,
  int FriendsCount,
  int StatusesCount,
  // Twitter's unique id for the user.
  int Id,
  string Name,
  string ProfileImageURL,
  // The user's handle.
  string ScreenName
)

To pass data retrieved from social networks to Braze, you’ll create a new FacebookUser or TwitterUser and then pass them to the method Appboy.SharedInstance.AppboyUser.SetFacebookData() or Appboy.SharedInstance.AppboyUser.SetTwitterData(). For example:

Twitter

1
2
3
4
5
6
7
8
9
10
11
12
var twitterUser = new TwitterUser {
  Description = "description",
  FollowersCount = 10,
  FriendsCount = 20,
  StatusesCount = 150,
  Id = 1000000,
  Name = "Name",
  ProfileImageURL = "https://si0.twimg.com/profile_images/00000/00000.jpeg",
  ScreenName = "handle"
};

Appboy.SharedInstance.AppboyUser.SetTwitterData(twitterUser);

Facebook

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Build a list of pages the user likes.
List likes = new List();
var like = new FacebookLike {
  Like = "Page Name"
};
likes.Add(like);

// Specify the user's city in a FacebookLocation object.
var location = new FacebookLocation {
  CityName = "City"
};

// Populate the FacebookUser object.
var facebookUser = new FacebookUser {
  Id = "100000",
  FirstName = "FirstName",
  LastName = "LastName",
  Email = "email@email.com",
  Birthday = "04/13/1990",
  Bio = "bio",
  LocationObject = location,
  Gender = "m",
  Likes = likes,
  NumFriends = 500
};

Appboy.SharedInstance.AppboyUser.SetFacebookData(facebookUser);
WAS THIS PAGE HELPFUL?
New Stuff!