这是官方文档的,部分段落没有翻译(一是能力有限,二是也有些翻译过来就变味了)。如有错误,欢迎指正。
Overview
社交测量允许你使用多种社交网络分享来测量一个用户的交互,推荐窗体小部件植入你的内容中。
社会互动由以下字段构成:
-
NSString
network – represents the social network with which the user is interacting (e.g. Google+, Facebook, Twitter, etc.). -
NSString
action – represents the social action taken (e.g. Like, Share, +1, etc.). -
NSString
target (optional) – represents the content on which the social action is being taken (i.e. a specific article or video).
Implementation
To send a social interaction to Google Analytics, callsendSocial:withAction:withTarget:
as in the following example, where an interaction with a Twitter Tweet button is measured on the Analytics developer site homepage:
[tracker sendSocial:@"Twitter" withAction:@"Tweet" withTarget:@"https://developers.google.com/analytics"]; // Send social interaction.