You are here

function ga_push_add_pageview in GA Push 7

Same name and namespace in other branches
  1. 8 ga_push.module \ga_push_add_pageview()

Push a GA pageview.

Page tracking allows you to measure the number of views you had of a particular page on your web site. For a web app, you might decide to track a page when a large portion of the screen changes, for example when the user goes from the home screen to the settings screen.

Example:

ga_push_add_pageview(array(
  'location' => 'https://google.com/analytics',
  'page' => '/my-overridden-page?id=1',
  'title' => 'My overridden page',
));

Parameters

array $push: An associative array containing:

  • location: string (optional) URL of the page being tracked. By default, analytics_js sets this to the full document URL, excluding the fragment identifier.
  • page: string (optional) A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.
  • title: string (optional) The title of the page.

string $method_key: @see ga_push_add()

array $options: @see ga_push_add()

See also

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

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

1 call to ga_push_add_pageview()
ga_push_action_push_pageview in ./ga_push.rules.inc
Add a push pageview from a rules action.

File

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

Code

function ga_push_add_pageview($push = array(), $method_key = NULL, $options = array()) {
  ga_push_add($push, GA_PUSH_TYPE_PAGEVIEW, $method_key, $options);
}