Home | History | Annotate | Download | only in dyn
      1 <html><body>
      2 <style>
      3 
      4 body, h1, h2, h3, div, span, p, pre, a {
      5   margin: 0;
      6   padding: 0;
      7   border: 0;
      8   font-weight: inherit;
      9   font-style: inherit;
     10   font-size: 100%;
     11   font-family: inherit;
     12   vertical-align: baseline;
     13 }
     14 
     15 body {
     16   font-size: 13px;
     17   padding: 1em;
     18 }
     19 
     20 h1 {
     21   font-size: 26px;
     22   margin-bottom: 1em;
     23 }
     24 
     25 h2 {
     26   font-size: 24px;
     27   margin-bottom: 1em;
     28 }
     29 
     30 h3 {
     31   font-size: 20px;
     32   margin-bottom: 1em;
     33   margin-top: 1em;
     34 }
     35 
     36 pre, code {
     37   line-height: 1.5;
     38   font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
     39 }
     40 
     41 pre {
     42   margin-top: 0.5em;
     43 }
     44 
     45 h1, h2, h3, p {
     46   font-family: Arial, sans serif;
     47 }
     48 
     49 h1, h2, h3 {
     50   border-bottom: solid #CCC 1px;
     51 }
     52 
     53 .toc_element {
     54   margin-top: 0.5em;
     55 }
     56 
     57 .firstline {
     58   margin-left: 2 em;
     59 }
     60 
     61 .method  {
     62   margin-top: 1em;
     63   border: solid 1px #CCC;
     64   padding: 1em;
     65   background: #EEE;
     66 }
     67 
     68 .details {
     69   font-weight: bold;
     70   font-size: 14px;
     71 }
     72 
     73 </style>
     74 
     75 <h1><a href="partners_v2.html">Google Partners API</a> . <a href="partners_v2.analytics.html">analytics</a></h1>
     76 <h2>Instance Methods</h2>
     77 <p class="toc_element">
     78   <code><a href="#list">list(pageSize=None, requestMetadata_userOverrides_ipAddress=None, requestMetadata_trafficSource_trafficSubId=None, requestMetadata_userOverrides_userId=None, x__xgafv=None, requestMetadata_locale=None, pageToken=None, requestMetadata_experimentIds=None, requestMetadata_trafficSource_trafficSourceId=None, requestMetadata_partnersSessionId=None)</a></code></p>
     79 <p class="firstline">Lists analytics data for a user's associated company.</p>
     80 <p class="toc_element">
     81   <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
     82 <p class="firstline">Retrieves the next page of results.</p>
     83 <h3>Method Details</h3>
     84 <div class="method">
     85     <code class="details" id="list">list(pageSize=None, requestMetadata_userOverrides_ipAddress=None, requestMetadata_trafficSource_trafficSubId=None, requestMetadata_userOverrides_userId=None, x__xgafv=None, requestMetadata_locale=None, pageToken=None, requestMetadata_experimentIds=None, requestMetadata_trafficSource_trafficSourceId=None, requestMetadata_partnersSessionId=None)</code>
     86   <pre>Lists analytics data for a user's associated company.
     87 Should only be called within the context of an authorized logged in user.
     88 
     89 Args:
     90   pageSize: integer, Requested page size. Server may return fewer analytics than requested.
     91 If unspecified or set to 0, default value is 30.
     92 Specifies the number of days in the date range when querying analytics.
     93 The `page_token` represents the end date of the date range
     94 and the start date is calculated using the `page_size` as the number
     95 of days BEFORE the end date.
     96 Must be a non-negative integer.
     97   requestMetadata_userOverrides_ipAddress: string, IP address to use instead of the user's geo-located IP address.
     98   requestMetadata_trafficSource_trafficSubId: string, Second level identifier to indicate where the traffic comes from.
     99 An identifier has multiple letters created by a team which redirected the
    100 traffic to us.
    101   requestMetadata_userOverrides_userId: string, Logged-in user ID to impersonate instead of the user's ID.
    102   x__xgafv: string, V1 error format.
    103     Allowed values
    104       1 - v1 error format
    105       2 - v2 error format
    106   requestMetadata_locale: string, Locale to use for the current request.
    107   pageToken: string, A token identifying a page of results that the server returns.
    108 Typically, this is the value of `ListAnalyticsResponse.next_page_token`
    109 returned from the previous call to
    110 ListAnalytics.
    111 Will be a date string in `YYYY-MM-DD` format representing the end date
    112 of the date range of results to return.
    113 If unspecified or set to "", default value is the current date.
    114   requestMetadata_experimentIds: string, Experiment IDs the current request belongs to. (repeated)
    115   requestMetadata_trafficSource_trafficSourceId: string, Identifier to indicate where the traffic comes from.
    116 An identifier has multiple letters created by a team which redirected the
    117 traffic to us.
    118   requestMetadata_partnersSessionId: string, Google Partners session ID.
    119 
    120 Returns:
    121   An object of the form:
    122 
    123     { # Response message for
    124       # ListAnalytics.
    125     "nextPageToken": "A String", # A token to retrieve next page of results.
    126         # Pass this value in the `ListAnalyticsRequest.page_token` field in the
    127         # subsequent call to
    128         # ListAnalytics to retrieve the
    129         # next page of results.
    130     "analytics": [ # The list of analytics.
    131         # Sorted in ascending order of
    132         # Analytics.event_date.
    133       { # Analytics data for a `Company` within a single day.
    134         "searchViews": { # Details of the analytics events for a `Company` within a single day. # Instances of users seeing the `Company` in Google Partners Search results
    135             # on the specified date.
    136           "eventLocations": [ # Location information of where these events occurred.
    137             { # An object representing a latitude/longitude pair. This is expressed as a pair
    138                 # of doubles representing degrees latitude and degrees longitude. Unless
    139                 # specified otherwise, this must conform to the
    140                 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
    141                 # standard</a>. Values must be within normalized ranges.
    142                 #
    143                 # Example of normalization code in Python:
    144                 #
    145                 #     def NormalizeLongitude(longitude):
    146                 #       """Wraps decimal degrees longitude to [-180.0, 180.0]."""
    147                 #       q, r = divmod(longitude, 360.0)
    148                 #       if r > 180.0 or (r == 180.0 and q <= -1.0):
    149                 #         return r - 360.0
    150                 #       return r
    151                 #
    152                 #     def NormalizeLatLng(latitude, longitude):
    153                 #       """Wraps decimal degrees latitude and longitude to
    154                 #       [-90.0, 90.0] and [-180.0, 180.0], respectively."""
    155                 #       r = latitude % 360.0
    156                 #       if r <= 90.0:
    157                 #         return r, NormalizeLongitude(longitude)
    158                 #       elif r >= 270.0:
    159                 #         return r - 360, NormalizeLongitude(longitude)
    160                 #       else:
    161                 #         return 180 - r, NormalizeLongitude(longitude + 180.0)
    162                 #
    163                 #     assert 180.0 == NormalizeLongitude(180.0)
    164                 #     assert -180.0 == NormalizeLongitude(-180.0)
    165                 #     assert -179.0 == NormalizeLongitude(181.0)
    166                 #     assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
    167                 #     assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
    168                 #     assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
    169                 #     assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
    170                 #     assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
    171                 #     assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
    172                 #     assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
    173                 #     assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
    174                 #     assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
    175                 #     assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
    176               "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
    177               "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
    178             },
    179           ],
    180           "eventCount": 42, # Number of times the type of event occurred.
    181               # Meaning depends on context (e.g. profile views, contacts, etc.).
    182         },
    183         "contacts": { # Details of the analytics events for a `Company` within a single day. # Instances of users contacting the `Company`
    184             # on the specified date.
    185           "eventLocations": [ # Location information of where these events occurred.
    186             { # An object representing a latitude/longitude pair. This is expressed as a pair
    187                 # of doubles representing degrees latitude and degrees longitude. Unless
    188                 # specified otherwise, this must conform to the
    189                 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
    190                 # standard</a>. Values must be within normalized ranges.
    191                 #
    192                 # Example of normalization code in Python:
    193                 #
    194                 #     def NormalizeLongitude(longitude):
    195                 #       """Wraps decimal degrees longitude to [-180.0, 180.0]."""
    196                 #       q, r = divmod(longitude, 360.0)
    197                 #       if r > 180.0 or (r == 180.0 and q <= -1.0):
    198                 #         return r - 360.0
    199                 #       return r
    200                 #
    201                 #     def NormalizeLatLng(latitude, longitude):
    202                 #       """Wraps decimal degrees latitude and longitude to
    203                 #       [-90.0, 90.0] and [-180.0, 180.0], respectively."""
    204                 #       r = latitude % 360.0
    205                 #       if r <= 90.0:
    206                 #         return r, NormalizeLongitude(longitude)
    207                 #       elif r >= 270.0:
    208                 #         return r - 360, NormalizeLongitude(longitude)
    209                 #       else:
    210                 #         return 180 - r, NormalizeLongitude(longitude + 180.0)
    211                 #
    212                 #     assert 180.0 == NormalizeLongitude(180.0)
    213                 #     assert -180.0 == NormalizeLongitude(-180.0)
    214                 #     assert -179.0 == NormalizeLongitude(181.0)
    215                 #     assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
    216                 #     assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
    217                 #     assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
    218                 #     assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
    219                 #     assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
    220                 #     assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
    221                 #     assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
    222                 #     assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
    223                 #     assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
    224                 #     assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
    225               "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
    226               "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
    227             },
    228           ],
    229           "eventCount": 42, # Number of times the type of event occurred.
    230               # Meaning depends on context (e.g. profile views, contacts, etc.).
    231         },
    232         "eventDate": { # Represents a whole calendar date, e.g. date of birth. The time of day and # Date on which these events occurred.
    233             # time zone are either specified elsewhere or are not significant. The date
    234             # is relative to the Proleptic Gregorian Calendar. The day may be 0 to
    235             # represent a year and month where the day is not significant, e.g. credit card
    236             # expiration date. The year may be 0 to represent a month and day independent
    237             # of year, e.g. anniversary date. Related types are google.type.TimeOfDay
    238             # and `google.protobuf.Timestamp`.
    239           "month": 42, # Month of year. Must be from 1 to 12.
    240           "day": 42, # Day of month. Must be from 1 to 31 and valid for the year and month, or 0
    241               # if specifying a year/month where the day is not significant.
    242           "year": 42, # Year of date. Must be from 1 to 9999, or 0 if specifying a date without
    243               # a year.
    244         },
    245         "profileViews": { # Details of the analytics events for a `Company` within a single day. # Instances of users viewing the `Company` profile
    246             # on the specified date.
    247           "eventLocations": [ # Location information of where these events occurred.
    248             { # An object representing a latitude/longitude pair. This is expressed as a pair
    249                 # of doubles representing degrees latitude and degrees longitude. Unless
    250                 # specified otherwise, this must conform to the
    251                 # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
    252                 # standard</a>. Values must be within normalized ranges.
    253                 #
    254                 # Example of normalization code in Python:
    255                 #
    256                 #     def NormalizeLongitude(longitude):
    257                 #       """Wraps decimal degrees longitude to [-180.0, 180.0]."""
    258                 #       q, r = divmod(longitude, 360.0)
    259                 #       if r > 180.0 or (r == 180.0 and q <= -1.0):
    260                 #         return r - 360.0
    261                 #       return r
    262                 #
    263                 #     def NormalizeLatLng(latitude, longitude):
    264                 #       """Wraps decimal degrees latitude and longitude to
    265                 #       [-90.0, 90.0] and [-180.0, 180.0], respectively."""
    266                 #       r = latitude % 360.0
    267                 #       if r <= 90.0:
    268                 #         return r, NormalizeLongitude(longitude)
    269                 #       elif r >= 270.0:
    270                 #         return r - 360, NormalizeLongitude(longitude)
    271                 #       else:
    272                 #         return 180 - r, NormalizeLongitude(longitude + 180.0)
    273                 #
    274                 #     assert 180.0 == NormalizeLongitude(180.0)
    275                 #     assert -180.0 == NormalizeLongitude(-180.0)
    276                 #     assert -179.0 == NormalizeLongitude(181.0)
    277                 #     assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
    278                 #     assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
    279                 #     assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
    280                 #     assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
    281                 #     assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
    282                 #     assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
    283                 #     assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
    284                 #     assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
    285                 #     assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
    286                 #     assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
    287               "latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
    288               "longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
    289             },
    290           ],
    291           "eventCount": 42, # Number of times the type of event occurred.
    292               # Meaning depends on context (e.g. profile views, contacts, etc.).
    293         },
    294       },
    295     ],
    296     "responseMetadata": { # Common data that is in each API response. # Current response metadata.
    297       "debugInfo": { # Debug information about this request. # Debug information about this request.
    298         "serverTraceInfo": "A String", # Server-side debug stack trace.
    299         "serviceUrl": "A String", # URL of the service that handled this request.
    300         "serverInfo": "A String", # Info about the server that serviced this request.
    301       },
    302     },
    303     "analyticsSummary": { # Analytics aggregated data for a `Company` for a given date range. # Aggregated information across the response's
    304         # analytics.
    305       "contactsCount": 42, # Aggregated number of times users contacted the `Company`
    306           # for given date range.
    307       "searchViewsCount": 42, # Aggregated number of times users saw the `Company`
    308           # in Google Partners Search results for given date range.
    309       "profileViewsCount": 42, # Aggregated number of profile views for the `Company` for given date range.
    310     },
    311   }</pre>
    312 </div>
    313 
    314 <div class="method">
    315     <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
    316   <pre>Retrieves the next page of results.
    317 
    318 Args:
    319   previous_request: The request for the previous page. (required)
    320   previous_response: The response from the request for the previous page. (required)
    321 
    322 Returns:
    323   A request object that you can call 'execute()' on to request the next
    324   page. Returns None if there are no more items in the collection.
    325     </pre>
    326 </div>
    327 
    328 </body></html>