Dirk Calloway
Dirk Calloway

Reputation: 2619

Google Analytics in real time for personalization

Is there a way in Google Analytics to get a visitors information in real time in order to personalize content?

For example, visitor A comes from Google using the "widgets" keyword and using a Chrome browser so I want to show him content related to Chrome based widgets.

Upvotes: 2

Views: 1218

Answers (2)

carlodurso
carlodurso

Reputation: 2894

Google Analytics provides a Real Time Reporting API as a developer preview in limited beta.

Real Time Reporting API Private Beta access request form.

With all the limitations that this means it may be worth giving a try.
You can find Java, PHP, and Python code examples on the documentation page: https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get


In PHP this is the anatomy of the call to the API:

$optParams = array(
    'dimensions' => 'rt:medium');

try {
  $results = $analytics->data_realtime->get(
      'ga:56789',
      'rt:keyword',
      $optParams);

Upvotes: 2

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116938

Probably not. Even if you request from the the Real-time API keyword you will find that. The Keyword returned is the Keyword from your own campaign tracking. So this would only work on links that you sent back to yourself Which really isn't what you want to do. Its a nice idea really

Documentation: rt:keyword

When using manual campaign tracking, the value of the utm_term campaign tracking parameter. When using AdWords autotagging or if a user used organic search to reach your property, the keywords used by users to reach your property. Otherwise the value is (not set).

What you are looking for is the keyword that would be used against a search engine. That keyword isn't returned via the Real-time api.

Upvotes: 0

Related Questions