You are here

function ga_push_add_social in GA Push 8

Same name and namespace in other branches
  1. 7 ga_push.module \ga_push_add_social()

Push a GA social.

Social Interaction Analytics allows you to measure the number of times users click on social buttons embedded in webpages. For example, you might measure a Facebook "Like" or a Twitter "Tweet."

Example:

ga_push_add_social(array(
  'socialNetwork' => 'facebook',
  'socialAction' => 'like',
  'socialTarget' => 'http://mycoolpage.com',
));

Parameters

array $push: An associative array containing:

  • socialNetwork: string (optional) The network on which the action occurs (e.g. Facebook, Twitter).
  • socialAction: string (optional) The type of action that happens (e.g. Like, Send, Tweet).
  • socialTarget: string (optional) Specifies the target of a social interaction. This value is typically a URL but can be any text.

string $method_key: Method key.

array $options: Extra options.

See also

https://developers.google.com/analytics/devguides/collection/analyticsjs...

https://developers.google.com/analytics/devguides/collection/gajs/gaTrac...

ga_push_add()

1 call to ga_push_add_social()
Social::doExecute in src/Plugin/RulesAction/Social.php
Executes the action with the given context.

File

./ga_push.module, line 526
Drupal Module: GA Push.

Code

function ga_push_add_social(array $push, $method_key = NULL, array $options = []) {
  ga_push_add($push, GA_PUSH_TYPE_SOCIAL, $method_key, $options);
}