Version Description
- Bug Fixes:
- if tracking is disabled it keeps it that way while upgrading from versions lower than 5.0
- fixes the undeclared variable gadwpSubmitObject error on submitted forms
- added deprecation warning for tracking_code method
- fix network admin menu capabilities, props by Maxime Culea
- Enhancements:
- switch to a customized version of GAPI to avoid conflicts with other plugins
- automatically remove amp/ from Google Analytics tracking page URL
- events tracking is now using data-vars-ga- attributes instead of data-ga-
- increase default report expiration cookie from 7 days to 365 days
- New Features:
- sampleRate support for web analytics and AMP
- custom dimensions tracking support for AMP
- scrolling depth tracking support for AMP
- form submit tracking support for AMP
- downloads, affiliate links, hashmarks, outbound links, telephones, e-mails tracking support for AMP
Download this release
Release Info
Developer | deconf |
Plugin | Google Analytics Dashboard for WP (GADWP) |
Version | 5.1 |
Comparing to | |
See all releases |
Code changes from version 5.0.1 to 5.1
- admin/css/gadwp.css +1 -1
- admin/settings.php +15 -5
- admin/setup.php +5 -5
- admin/views/access-code.php +36 -0
- common/js/reports5.js +1 -1
- config.php +16 -1
- front/js/tracking-analytics-events.js +1 -1
- front/js/tracking-tagmanager-events.js +1 -1
- front/setup.php +1 -1
- front/tracking-analytics.php +236 -83
- front/tracking-tagmanager.php +9 -3
- front/tracking.php +10 -1
- front/views/analytics-amp-code.php +14 -0
- front/views/analytics-code.php +9 -1
- front/views/optimize-code.php +9 -0
- front/views/tagmanager-code.php +9 -1
- gadwp.php +2 -2
- install/install.php +3 -0
- readme.txt +39 -2
- tools/gapi.php +26 -46
- tools/src/{Google → Deconf}/Auth/Abstract.php +6 -6
- tools/src/{Google → Deconf}/Auth/AppIdentity.php +8 -8
- tools/src/{Google → Deconf}/Auth/AssertionCredentials.php +7 -7
- tools/src/{Google → Deconf}/Auth/ComputeEngine.php +17 -17
- tools/src/{Google → Deconf}/Auth/Exception.php +2 -2
- tools/src/{Google → Deconf}/Auth/LoginTicket.php +4 -4
- tools/src/{Google → Deconf}/Auth/OAuth2.php +50 -50
- tools/src/{Google → Deconf}/Auth/Simple.php +7 -7
- tools/src/{Google → Deconf}/Cache/Abstract.php +2 -2
- tools/src/{Google → Deconf}/Cache/Apc.php +6 -6
- tools/src/{Google → Deconf}/Cache/Exception.php +2 -2
- tools/src/{Google → Deconf}/Cache/File.php +6 -6
- tools/src/{Google → Deconf}/Cache/Memcache.php +9 -9
- tools/src/{Google → Deconf}/Cache/Null.php +3 -3
- tools/src/{Google → Deconf}/Client.php +50 -50
- tools/src/{Google → Deconf}/Collection.php +3 -3
- tools/src/{Google → Deconf}/Config.php +18 -18
- tools/src/{Google → Deconf}/Exception.php +1 -1
- tools/src/{Google → Deconf}/Http/Batch.php +11 -11
- tools/src/{Google → Deconf}/Http/CacheParser.php +11 -11
- tools/src/{Google → Deconf}/Http/MediaFileUpload.php +14 -14
- tools/src/{Google → Deconf}/Http/REST.php +21 -21
- tools/src/{Google → Deconf}/Http/Request.php +4 -4
- tools/src/{Google → Deconf}/IO/Abstract.php +28 -28
- tools/src/{Google → Deconf}/IO/Curl.php +13 -13
- tools/src/{Google → Deconf}/IO/Exception.php +2 -2
- tools/src/{Google → Deconf}/IO/Stream.php +10 -10
- tools/src/{Google → Deconf}/IO/cacerts.pem +0 -0
- tools/src/{Google → Deconf}/Logger/Abstract.php +10 -10
- tools/src/{Google → Deconf}/Logger/Exception.php +2 -2
- tools/src/{Google → Deconf}/Logger/File.php +9 -9
- tools/src/{Google → Deconf}/Logger/Null.php +2 -2
- tools/src/{Google → Deconf}/Logger/Psr.php +5 -5
- tools/src/{Google → Deconf}/Model.php +6 -6
- tools/src/{Google → Deconf}/Service.php +6 -6
- tools/src/{Google → Deconf}/Service/Analytics.php +509 -509
- tools/src/{Google → Deconf}/Service/Exception.php +2 -2
- tools/src/{Google → Deconf}/Service/Resource.php +13 -13
- tools/src/{Google → Deconf}/Signer/Abstract.php +1 -1
- tools/src/{Google → Deconf}/Signer/P12.php +8 -8
- tools/src/{Google → Deconf}/Task/Exception.php +2 -2
- tools/src/{Google → Deconf}/Task/Retryable.php +2 -2
- tools/src/{Google → Deconf}/Task/Runner.php +15 -15
- tools/src/{Google → Deconf}/Utils.php +1 -1
- tools/src/{Google → Deconf}/Utils/URITemplate.php +1 -1
- tools/src/{Google → Deconf}/Verifier/Abstract.php +1 -1
- tools/src/{Google → Deconf}/Verifier/Pem.php +8 -8
- tools/src/{Google → Deconf}/autoload.php +1 -1
- tools/tools.php +16 -2
admin/css/gadwp.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#gadwp-events,#gadwp-custom,#gadwp-advanced,#gadwp-exclude,#gadwp-config,#gadwp-tmdatalayervars,#gadwp-tmintegration,#gadwp-integration{display:none}table.gadwp-settings-options{padding-left:10px;width:100%}.gadwp-settings-options td{padding:0 5px 5px 5px}td.gadwp-settings-title,td.info{width:140px;padding-left:20px}td.gadwp-settings-title-s{width:300px}.gadwp-help{padding-left:15px}td.gadwp-settings-info{padding-bottom:15px}td.gadwp-settings-title label{font-size:1.1em}.gadash-title{float:left;margin-right:10px;margin-top:2px;clear:left}.gadash-desc{font-size:1em}.gadash-top{vertical-align:top}pre.gadwp-settings-logdata{white-space:pre-wrap}td.gadwp-settings-roles{padding-bottom:15px}#ga_speed_samplerate,#ga_realtime_pages{width:50px}#gapi-access-code{color:red !important}#poststuff.gadwp h2{padding-bottom:0;font-size:19.5px;font-weight:normal;padding:0;margin:20px 0 15px 0}#poststuff.gadwp h2.nav-tab-wrapper{border-bottom:1px solid #ccc;padding-bottom:0}.button-primary.gadwp-settings-switchoo{position:relative;width:50px;float:left;border:0;padding:0;height:22px;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}input.gadwp-settings-switchoo-checkbox{display:none}.gadwp-settings-switchoo-label{display:block;overflow:hidden;cursor:pointer;background:transparent;border:1px solid #ddd;border-radius:2px;text-shadow:none}.gadwp-settings-switchoo-inner{width:200%;margin-left:-100%;border-radius:2px;-moz-transition:margin .2s ease-in 0;-webkit-transition:margin .2s ease-in 0;-o-transition:margin .2s ease-in 0;transition:margin .2s ease-in 0}.gadwp-settings-switchoo-inner:before,.gadwp-settings-switchoo-inner:after{float:left;width:50%;font-weight:normal;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;height:22px;line-height:22px;font-size:12px;text-shadow:none}.gadwp-settings-switchoo-inner:before{content:"On";padding-left:5px;border-bottom:0}.gadwp-settings-switchoo-inner:after{content:"Off";padding-right:5px;background-color:#ddd;text-align:right}.gadwp-settings-switchoo-switch{width:22px;height:22px;background:#fff;color:#ddd;border:1px solid #ddd;border-radius:2px;position:absolute;top:0;bottom:0;right:27px;-moz-transition:all .2s ease-in 0;-webkit-transition:all .2s ease-in 0;-o-transition:all .2s ease-in 0;transition:all .2s ease-in 0}.gadwp-settings-switchoo-switch:hover{color:#aaa;border-color:#aaa}.gadwp-settings-switchoo-switch:after{margin:0;outline:0;display:inline-block;font:400 16px/16px dashicons;content:"\f228";padding:3px 0 0 3px;text-align:left;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-inner{margin-left:0}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-switch{right:0}.switch-desc{float:left;margin-left:10px;line-height:20px}
|
1 |
+
#gadwp-events,#gadwp-custom,#gadwp-advanced,#gadwp-exclude,#gadwp-config,#gadwp-tmdatalayervars,#gadwp-tmintegration,#gadwp-integration{display:none}table.gadwp-settings-options{padding-left:10px;width:100%}.gadwp-settings-options td{padding:0 5px 5px 5px}td.gadwp-settings-title,td.info{width:140px;padding-left:20px}td.gadwp-settings-title-s{width:300px}.gadwp-help{padding-left:15px}td.gadwp-settings-info{padding-bottom:15px}td.gadwp-settings-title label{font-size:1.1em}.gadash-title{float:left;margin-right:10px;margin-top:2px;clear:left}.gadash-desc{font-size:1em}.gadash-top{vertical-align:top}pre.gadwp-settings-logdata{white-space:pre-wrap}td.gadwp-settings-roles{padding-bottom:15px}#ga_speed_samplerate,#ga_user_samplerate,#ga_realtime_pages{width:50px}#gapi-access-code{color:red !important}#poststuff.gadwp h2{padding-bottom:0;font-size:19.5px;font-weight:normal;padding:0;margin:20px 0 15px 0}#poststuff.gadwp h2.nav-tab-wrapper{border-bottom:1px solid #ccc;padding-bottom:0}.button-primary.gadwp-settings-switchoo{position:relative;width:50px;float:left;border:0;padding:0;height:22px;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}input.gadwp-settings-switchoo-checkbox{display:none}.gadwp-settings-switchoo-label{display:block;overflow:hidden;cursor:pointer;background:transparent;border:1px solid #ddd;border-radius:2px;text-shadow:none}.gadwp-settings-switchoo-inner{width:200%;margin-left:-100%;border-radius:2px;-moz-transition:margin .2s ease-in 0;-webkit-transition:margin .2s ease-in 0;-o-transition:margin .2s ease-in 0;transition:margin .2s ease-in 0}.gadwp-settings-switchoo-inner:before,.gadwp-settings-switchoo-inner:after{float:left;width:50%;font-weight:normal;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;height:22px;line-height:22px;font-size:12px;text-shadow:none}.gadwp-settings-switchoo-inner:before{content:"On";padding-left:5px;border-bottom:0}.gadwp-settings-switchoo-inner:after{content:"Off";padding-right:5px;background-color:#ddd;text-align:right}.gadwp-settings-switchoo-switch{width:22px;height:22px;background:#fff;color:#ddd;border:1px solid #ddd;border-radius:2px;position:absolute;top:0;bottom:0;right:27px;-moz-transition:all .2s ease-in 0;-webkit-transition:all .2s ease-in 0;-o-transition:all .2s ease-in 0;transition:all .2s ease-in 0}.gadwp-settings-switchoo-switch:hover{color:#aaa;border-color:#aaa}.gadwp-settings-switchoo-switch:after{margin:0;outline:0;display:inline-block;font:400 16px/16px dashicons;content:"\f228";padding:3px 0 0 3px;text-align:left;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-inner{margin-left:0}.gadwp-settings-switchoo-checkbox:checked+.gadwp-settings-switchoo-label .gadwp-settings-switchoo-switch{right:0}.switch-desc{float:left;margin-left:10px;line-height:20px}
|
admin/settings.php
CHANGED
@@ -691,7 +691,7 @@ final class GADWP_Settings {
|
|
691 |
</tr>
|
692 |
<tr>
|
693 |
<td class="gadwp-settings-title">
|
694 |
-
<label for="ga_speed_samplerate"><?php _e("
|
695 |
</label>
|
696 |
</td>
|
697 |
<td>
|
@@ -699,6 +699,16 @@ final class GADWP_Settings {
|
|
699 |
%
|
700 |
</td>
|
701 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
702 |
<tr>
|
703 |
<td colspan="2" class="gadwp-settings-title">
|
704 |
<div class="button-primary gadwp-settings-switchoo">
|
@@ -1099,10 +1109,10 @@ final class GADWP_Settings {
|
|
1099 |
$options = self::update_options( 'general' );
|
1100 |
}
|
1101 |
}
|
1102 |
-
} catch (
|
1103 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $gadwp->gapi_controller->error_timeout );
|
1104 |
return false;
|
1105 |
-
} catch (
|
1106 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $gadwp->gapi_controller->error_timeout );
|
1107 |
GADWP_Tools::set_cache( 'gapi_errors', $e->getErrors(), $gadwp->gapi_controller->error_timeout );
|
1108 |
return $e->getCode();
|
@@ -1393,10 +1403,10 @@ final class GADWP_Settings {
|
|
1393 |
$options = self::update_options( 'network' );
|
1394 |
}
|
1395 |
}
|
1396 |
-
} catch (
|
1397 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $gadwp->gapi_controller->error_timeout );
|
1398 |
return false;
|
1399 |
-
} catch (
|
1400 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $gadwp->gapi_controller->error_timeout );
|
1401 |
GADWP_Tools::set_cache( 'gapi_errors', $e->getErrors(), $gadwp->gapi_controller->error_timeout );
|
1402 |
return $e->getCode();
|
691 |
</tr>
|
692 |
<tr>
|
693 |
<td class="gadwp-settings-title">
|
694 |
+
<label for="ga_speed_samplerate"><?php _e("Speed Sample Rate:", 'google-analytics-dashboard-for-wp'); ?>
|
695 |
</label>
|
696 |
</td>
|
697 |
<td>
|
699 |
%
|
700 |
</td>
|
701 |
</tr>
|
702 |
+
<tr>
|
703 |
+
<td class="gadwp-settings-title">
|
704 |
+
<label for="ga_user_samplerate"><?php _e("User Sample Rate:", 'google-analytics-dashboard-for-wp'); ?>
|
705 |
+
</label>
|
706 |
+
</td>
|
707 |
+
<td>
|
708 |
+
<input type="number" id="ga_user_samplerate" name="options[ga_user_samplerate]" value="<?php echo (int)($options['ga_user_samplerate']); ?>" max="100" min="1">
|
709 |
+
%
|
710 |
+
</td>
|
711 |
+
</tr>
|
712 |
<tr>
|
713 |
<td colspan="2" class="gadwp-settings-title">
|
714 |
<div class="button-primary gadwp-settings-switchoo">
|
1109 |
$options = self::update_options( 'general' );
|
1110 |
}
|
1111 |
}
|
1112 |
+
} catch ( Deconf_IO_Exception $e ) {
|
1113 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $gadwp->gapi_controller->error_timeout );
|
1114 |
return false;
|
1115 |
+
} catch ( Deconf_Service_Exception $e ) {
|
1116 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $gadwp->gapi_controller->error_timeout );
|
1117 |
GADWP_Tools::set_cache( 'gapi_errors', $e->getErrors(), $gadwp->gapi_controller->error_timeout );
|
1118 |
return $e->getCode();
|
1403 |
$options = self::update_options( 'network' );
|
1404 |
}
|
1405 |
}
|
1406 |
+
} catch ( Deconf_IO_Exception $e ) {
|
1407 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $gadwp->gapi_controller->error_timeout );
|
1408 |
return false;
|
1409 |
+
} catch ( Deconf_Service_Exception $e ) {
|
1410 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $gadwp->gapi_controller->error_timeout );
|
1411 |
GADWP_Tools::set_cache( 'gapi_errors', $e->getErrors(), $gadwp->gapi_controller->error_timeout );
|
1412 |
return $e->getCode();
|
admin/setup.php
CHANGED
@@ -53,10 +53,10 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
|
|
53 |
*/
|
54 |
public function network_menu() {
|
55 |
global $wp_version;
|
56 |
-
if ( current_user_can( '
|
57 |
include ( GADWP_DIR . 'admin/settings.php' );
|
58 |
-
add_menu_page( __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), "Google Analytics", '
|
59 |
-
add_submenu_page( 'gadash_settings', __( "General Settings", 'google-analytics-dashboard-for-wp' ), __( "General Settings", 'google-analytics-dashboard-for-wp' ), '
|
60 |
add_submenu_page( 'gadash_settings', __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadash_errors_debugging', array( 'GADWP_Settings', 'errors_debugging' ) );
|
61 |
}
|
62 |
}
|
@@ -190,7 +190,7 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
|
|
190 |
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
|
191 |
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
|
192 |
__( "Invalid response", 'google-analytics-dashboard-for-wp' ),
|
193 |
-
__( "
|
194 |
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
|
195 |
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
|
196 |
__( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadash_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
|
@@ -290,7 +290,7 @@ if ( ! class_exists( 'GADWP_Backend_Setup' ) ) {
|
|
290 |
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
|
291 |
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
|
292 |
__( "Invalid response", 'google-analytics-dashboard-for-wp' ),
|
293 |
-
__( "
|
294 |
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
|
295 |
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
|
296 |
__( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadash_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
|
53 |
*/
|
54 |
public function network_menu() {
|
55 |
global $wp_version;
|
56 |
+
if ( current_user_can( 'manage_network' ) ) {
|
57 |
include ( GADWP_DIR . 'admin/settings.php' );
|
58 |
+
add_menu_page( __( "Google Analytics", 'google-analytics-dashboard-for-wp' ), "Google Analytics", 'manage_network', 'gadash_settings', array( 'GADWP_Settings', 'general_settings_network' ), version_compare( $wp_version, '3.8.0', '>=' ) ? 'dashicons-chart-area' : GADWP_URL . 'admin/images/gadash-icon.png' );
|
59 |
+
add_submenu_page( 'gadash_settings', __( "General Settings", 'google-analytics-dashboard-for-wp' ), __( "General Settings", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadash_settings', array( 'GADWP_Settings', 'general_settings_network' ) );
|
60 |
add_submenu_page( 'gadash_settings', __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), __( "Errors & Debug", 'google-analytics-dashboard-for-wp' ), 'manage_network', 'gadash_errors_debugging', array( 'GADWP_Settings', 'errors_debugging' ) );
|
61 |
}
|
62 |
}
|
190 |
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
|
191 |
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
|
192 |
__( "Invalid response", 'google-analytics-dashboard-for-wp' ),
|
193 |
+
__( "No Data", 'google-analytics-dashboard-for-wp' ),
|
194 |
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
|
195 |
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
|
196 |
__( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadash_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
|
290 |
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
|
291 |
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
|
292 |
__( "Invalid response", 'google-analytics-dashboard-for-wp' ),
|
293 |
+
__( "No Data", 'google-analytics-dashboard-for-wp' ),
|
294 |
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
|
295 |
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
|
296 |
__( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . menu_page_url( 'gadash_settings', false ) . '">' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</a>.',
|
admin/views/access-code.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Alin Marcu
|
4 |
+
* Copyright 2017 Alin Marcu
|
5 |
+
* Author URI: https://deconf.com
|
6 |
+
* License: GPLv2 or later
|
7 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<form name="input" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" method="post">
|
11 |
+
<table class="gadwp-settings-options">
|
12 |
+
<tr>
|
13 |
+
<td colspan="2" class="gadwp-settings-info">
|
14 |
+
<?php echo __( "Use this link to get your access code:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . $data['authUrl'] . '" id="gapi-access-code" target="_blank">' . __ ( "Get Access Code", 'google-analytics-dashboard-for-wp' ) . '</a>.'; ?>
|
15 |
+
</td>
|
16 |
+
</tr>
|
17 |
+
<tr>
|
18 |
+
<td class="gadwp-settings-title">
|
19 |
+
<label for="ga_dash_code" title="<?php _e("Use the red link to get your access code!",'google-analytics-dashboard-for-wp')?>"><?php echo _e( "Access Code:", 'google-analytics-dashboard-for-wp' ); ?></label>
|
20 |
+
</td>
|
21 |
+
<td>
|
22 |
+
<input type="text" id="ga_dash_code" name="ga_dash_code" value="" size="61" required="required" title="<?php _e("Use the red link to get your access code!",'google-analytics-dashboard-for-wp')?>">
|
23 |
+
</td>
|
24 |
+
</tr>
|
25 |
+
<tr>
|
26 |
+
<td colspan="2">
|
27 |
+
<hr>
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
<tr>
|
31 |
+
<td colspan="2">
|
32 |
+
<input type="submit" class="button button-secondary" name="ga_dash_authorize" value="<?php _e( "Save Access Code", 'google-analytics-dashboard-for-wp' ); ?>" />
|
33 |
+
</td>
|
34 |
+
</tr>
|
35 |
+
</table>
|
36 |
+
</form>
|
common/js/reports5.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";if(gadwpItemData.mapsApiKey){google.charts.load("current",{mapsApiKey:gadwpItemData.mapsApiKey,packages:["corechart","table","orgchart","geochart"]})}else{google.charts.load("current",{packages:["corechart","table","orgchart","geochart"]})}google.charts.setOnLoadCallback(GADWPReportLoad);gadwpItemData.getID=function(a){if(gadwpItemData.scope=="admin-item"){if(typeof a.id=="undefined"){return 0}if(a.id.split("-")[1]=="undefined"){return 0}else{return a.id.split("-")[1]}}else{if(typeof a.id=="undefined"){return 1}if(a.id.split("-")[4]=="undefined"){return 1}else{return a.id.split("-")[4]}}};gadwpItemData.getSelector=function(a){if(a=="admin-item"){return'a[id^="gadwp-"]'}else{return'li[id^="wp-admin-bar-gadwp"] a'}};gadwpItemData.responsiveDialog=function(){var b,a,c;c=jQuery(".ui-dialog:visible");c.each(function(){b=jQuery(this).find(".ui-dialog-content").data("ui-dialog");if(b.options.fluid){a=jQuery(window).width();if(a<(parseInt(b.options.maxWidth)+50)){jQuery(this).css("max-width","90%")}else{jQuery(this).css("max-width",b.options.maxWidth+"px")}b.option("position",b.options.position)}})};jQuery.fn.extend({gadwpItemReport:function(g){var a,d,h,e,f,i,c,b="-"+g;d={setCookie:function(k,m){var j,l=new Date();if(gadwpItemData.scope=="admin-widgets"){k="gadwp_wg_"+k}else{k="gadwp_ir_"+k}l.setTime(l.getTime()+(24*60*60*1000*7));j="expires="+l.toUTCString();document.cookie=k+"="+m+"; "+j+"; path=/"},getCookie:function(j){var l,m,n,k=0;if(gadwpItemData.scope=="admin-widgets"){j="gadwp_wg_"+j+"="}else{j="gadwp_ir_"+j+"="}m=document.cookie.split(";");for(k=0;k<m.length;k++){l=m[k];while(l.charAt(0)==" "){l=l.substring(1)}if(l.indexOf(j)==0){return l.substring(j.length,l.length)}}return false},escape:function(j){div=document.createElement("div");div.appendChild(document.createTextNode(j));return div.innerHTML}};h={addOptions:function(o,n){var j,l,m,k=[];if(!d.getCookie("default_metric")||!d.getCookie("default_dimension")||!d.getCookie("default_swmetric")){j="sessions";l="30daysAgo";if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){c="pageviews"}else{c="sessions"}d.setCookie("default_metric",j);d.setCookie("default_dimension",l);d.setCookie("default_swmetric",c)}else{j=d.getCookie("default_metric");l=d.getCookie("default_dimension");m=d.getCookie("default_view");c=d.getCookie("default_swmetric")}if(n==false){if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){k=""}else{k='<span id="gadwp-swmetric-sessions" title="'+gadwpItemData.i18n[5]+'" class="dashicons dashicons-clock" style="font-size:22px;padding:4px;"></span>'}k+='<span id="gadwp-swmetric-users" title="'+gadwpItemData.i18n[6]+'" class="dashicons dashicons-admin-users" style="font-size:22px;padding:4px;"></span>';k+='<span id="gadwp-swmetric-pageviews" title="'+gadwpItemData.i18n[7]+'" class="dashicons dashicons-admin-page" style="font-size:22px;padding:4px;"></span>';jQuery(o).html(k);jQuery("#gadwp-swmetric-"+c).css("color","#008ec2")}else{jQuery.each(n,function(p,q){if(p==j||p==l||p==m){k.push('<option value="'+p+'" selected="selected">'+q+"</option>")}else{k.push('<option value="'+p+'">'+q+"</option>")}});jQuery(o).html(k.join(""))}},init:function(){var j;if(!jQuery("#gadwp-window"+b).length){return}if(jQuery("#gadwp-window"+b).html().length){return}j='<div id="gadwp-container'+b+'">';if(gadwpItemData.viewList!=false){j+='<select id="gadwp-sel-view'+b+'"></select>'}j+='<select id="gadwp-sel-period'+b+'"></select> ';j+='<select id="gadwp-sel-report'+b+'"></select>';j+='<div id="gadwp-sel-metric'+b+'" style="float:right;display:none;">';j+="</div>";j+='<div id="gadwp-progressbar'+b+'"></div>';j+='<div id="gadwp-status'+b+'"></div>';j+='<div id="gadwp-reports'+b+'"></div>';j+='<div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">';j+=gadwpItemData.i18n[14];j+=' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=back_report&utm_campaign=gadwp" rel="nofollow" style="text-decoration:none;font-size:1em;">GADWP</a> ';j+="</div>";j+="</div>",jQuery("#gadwp-window"+b).append(j);h.addOptions("#gadwp-sel-view"+b,gadwpItemData.viewList);h.addOptions("#gadwp-sel-period"+b,gadwpItemData.dateList);h.addOptions("#gadwp-sel-report"+b,gadwpItemData.reportList);h.addOptions("#gadwp-sel-metric"+b,false)}};e={oldViewPort:0,orgChartTableChartData:"",tableChartData:"",orgChartPieChartsData:"",geoChartTableChartData:"",areaChartBottomStatsData:"",realtime:"",rtRuns:null,i18n:null,getTitle:function(j){if(j=="admin-item"){return jQuery("#gadwp"+b).attr("title")}else{return document.getElementsByTagName("title")[0].innerHTML}},alertMessage:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});jQuery("#gadwp-status"+b).html(j)},areaChartBottomStats:function(j){e.areaChartBottomStatsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();if(a.query=="visitBounceRate,bottomstats"){e.drawAreaChart(j[0],true)}else{e.drawAreaChart(j[0],false)}}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-areachart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){jQuery("#gadwp-reports"+b).show();e.drawBottomStats(j[1])}else{e.throwDebug(j[1])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-bottomstats"+b,j[1],"40px")}}else{e.throwDebug(j)}NProgress.done()},orgChartPieCharts:function(j){var k=0;e.orgChartPieChartsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}for(k=1;k<j.length;k++){if(!jQuery.isNumeric(j[k])){if(jQuery.isArray(j[k])){jQuery("#gadwp-reports"+b).show();e.drawPieChart("piechart-"+k,j[k],e.i18n[k])}else{e.throwDebug(j[k])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-piechart-"+k+b,j[k],"80px")}}}else{e.throwDebug(j)}NProgress.done()},geoChartTableChart:function(j){e.geoChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawGeoChart(j[0]);e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-geochart"+b,j[0],"125px");e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},orgChartTableChart:function(j){e.orgChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){e.drawTableChart(j[1])}else{e.throwDebug(j[1])}}else{e.throwError("#gadwp-tablechart"+b,j[1],"125px")}}else{e.throwDebug(j)}NProgress.done()},tableChart:function(j){e.tableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},drawTableChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={page:"enable",pageSize:10,width:"100%",allowHtml:true};k=new google.visualization.Table(document.getElementById("gadwp-tablechart"+b));k.draw(l,j)},drawOrgChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={allowCollapse:true,allowHtml:true,height:"100%"};k=new google.visualization.OrgChart(document.getElementById("gadwp-orgchart"+b));k.draw(l,j)},drawPieChart:function(o,m,n){var l,j,k;l=google.visualization.arrayToDataTable(m);j={is3D:false,tooltipText:"percentage",legend:"none",chartArea:{width:"99%",height:"80%"},title:n,pieSliceText:"value",colors:gadwpItemData.colorVariations};k=new google.visualization.PieChart(document.getElementById("gadwp-"+o+b));k.draw(l,j)},drawGeoChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={chartArea:{width:"99%",height:"90%"},colors:[gadwpItemData.colorVariations[5],gadwpItemData.colorVariations[4]]};if(gadwpItemData.region){j.region=gadwpItemData.region;j.displayMode="markers";j.datalessRegionColor="EFEFEF"}k=new google.visualization.GeoChart(document.getElementById("gadwp-geochart"+b));k.draw(l,j)},drawAreaChart:function(n,o){var m,j,l,k;m=google.visualization.arrayToDataTable(n);if(o){k=new google.visualization.NumberFormat({suffix:"%",fractionDigits:2});k.format(m,1)}j={legend:{position:"none"},pointSize:3,colors:[gadwpItemData.colorVariations[0],gadwpItemData.colorVariations[4]],chartArea:{width:"99%",height:"90%"},vAxis:{textPosition:"in",minValue:0},hAxis:{textPosition:"none"}};l=new google.visualization.AreaChart(document.getElementById("gadwp-areachart"+b));l.draw(m,j)},drawBottomStats:function(j){jQuery("#gdsessions"+b).html(j[0]);jQuery("#gdusers"+b).html(j[1]);jQuery("#gdpageviews"+b).html(j[2]);jQuery("#gdbouncerate"+b).html(j[3]);jQuery("#gdorganicsearch"+b).html(j[4]);jQuery("#gdpagespervisit"+b).html(j[5]);jQuery("#gdpagetime"+b).html(j[6]);jQuery("#gdpageload"+b).html(j[7]);jQuery("#gdsessionduration"+b).html(j[8])},rtOnlyUniqueValues:function(l,k,j){return j.indexOf(l)===k},rtCountSessions:function(k,m){var l=0,j=0;for(j=0;j<k.rows.length;j++){if(jQuery.inArray(m,k.rows[j])>-1){l+=parseInt(k.rows[j][6])}}return l},rtGenerateTooltip:function(k){var m=0,l="",j=0;for(j=0;j<k.length;j++){m+=parseInt(k[j].count);l+="<tr><td class='gadwp-pgdetailsl'>"+k[j].value+"</td><td class='gadwp-pgdetailsr'>"+k[j].count+"</td></tr>"}if(m){return("<table>"+l+"</table>")}else{return("")}},rtPageDetails:function(y,n){var w,o,r,x=0,v=0,m=0,s=0,t=0,z=0,C=0,q=0,l=0,u="",A="",p="",k="",B="";y=y.rows;for(x=0;x<y.length;x++){if(y[x][0]==n){o=y[x][5];switch(y[x][3]){case"REFERRAL":t+=parseInt(y[x][6]);u+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"ORGANIC":z+=parseInt(y[x][6]);A+="<tr><td class='gadwp-pgdetailsl'>"+y[x][2]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"SOCIAL":q+=parseInt(y[x][6]);p+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"CUSTOM":l+=parseInt(y[x][6]);k+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"DIRECT":C+=parseInt(y[x][6]);break}}}if(t){u="<table><tr><td>"+e.i18n[0]+"("+t+")</td></tr>"+u+"</table><br />"}if(z){A="<table><tr><td>"+e.i18n[1]+"("+z+")</td></tr>"+A+"</table><br />"}if(q){p="<table><tr><td>"+e.i18n[2]+"("+q+")</td></tr>"+p+"</table><br />"}if(l){k="<table><tr><td>"+e.i18n[3]+"("+l+")</td></tr>"+k+"</table><br />"}if(C){B="<table><tr><td>"+e.i18n[4]+"("+C+")</td></tr></table><br />"}return("<p><center><strong>"+o+"</strong></center></p>"+u+A+p+k+B)},rtRefresh:function(){if(e.render.focusFlag){a.from=false;a.to=false;a.query="realtime";jQuery.post(gadwpItemData.ajaxurl,a,function(j){if(jQuery.isArray(j)){jQuery("#gadwp-reports"+b).show();e.realtime=j[0];e.drawRealtime(e.realtime)}else{e.throwDebug(j)}NProgress.done()})}},drawRealtime:function(y){var j,n,o,w,t,r,x=0,v=[],z=[],p=[],m=[],q=[],k=[],l=[],s="",o=[],w=[],t=[],r=[],u=["REFERRAL","ORGANIC","SOCIAL","CUSTOM"],A=["DIRECT","NEW"];jQuery(function(){jQuery("#gadwp-widget *").tooltip({tooltipClass:"gadwp"})});y=y[0];if(jQuery.isNumeric(y)||typeof y==="undefined"){y=[];y.totalsForAllResults=[];y.totalsForAllResults["rt:activeUsers"]="0";y.rows=[]}if(y.totalsForAllResults["rt:activeUsers"]!==document.getElementById("gadwp-online").innerHTML){jQuery("#gadwp-online").fadeOut("slow");jQuery("#gadwp-online").fadeOut(500);jQuery("#gadwp-online").fadeOut("slow",function(){if((parseInt(y.totalsForAllResults["rt:activeUsers"]))<(parseInt(document.getElementById("gadwp-online").innerHTML))){jQuery("#gadwp-online").css({"background-color":"#FFE8E8"})}else{jQuery("#gadwp-online").css({"background-color":"#E0FFEC"})}document.getElementById("gadwp-online").innerHTML=y.totalsForAllResults["rt:activeUsers"]});jQuery("#gadwp-online").fadeIn("slow");jQuery("#gadwp-online").fadeIn(500);jQuery("#gadwp-online").fadeIn("slow",function(){jQuery("#gadwp-online").css({"background-color":"#FFFFFF"})})}if(y.totalsForAllResults["rt:activeUsers"]==0){y.rows=[]}for(x=0;x<y.rows.length;x++){v.push(y.rows[x][0]);if(y.rows[x][3]=="REFERRAL"){z.push(y.rows[x][1])}if(y.rows[x][3]=="ORGANIC"){p.push(y.rows[x][2])}if(y.rows[x][3]=="SOCIAL"){m.push(y.rows[x][1])}if(y.rows[x][3]=="CUSTOM"){k.push(y.rows[x][1])}q.push(y.rows[x][3])}n=v.filter(e.rtOnlyUniqueValues);for(x=0;x<n.length;x++){l[x]={pagepath:n[x],count:e.rtCountSessions(y,n[x])}}l.sort(function(C,B){return B.count-C.count});s="";for(x=0;x<l.length;x++){if(x<gadwpItemData.rtLimitPages){s+='<div class="gadwp-pline"><div class="gadwp-pleft"><a href="#" data-gadwp="'+e.rtPageDetails(y,l[x].pagepath)+'">'+l[x].pagepath.substring(0,70)+'</a></div><div class="gadwp-pright">'+l[x].count+"</div></div>"}}document.getElementById("gadwp-pages").innerHTML='<br /><div class="gadwp-pg">'+s+"</div>";o=z.filter(e.rtOnlyUniqueValues);for(x=0;x<o.length;x++){o[x]={value:o[x],count:e.rtCountSessions(y,o[x])}}o.sort(function(C,B){return B.count-C.count});w=p.filter(e.rtOnlyUniqueValues);for(x=0;x<w.length;x++){w[x]={value:w[x],count:e.rtCountSessions(y,w[x])}}w.sort(function(C,B){return B.count-C.count});t=m.filter(e.rtOnlyUniqueValues);for(x=0;x<t.length;x++){t[x]={value:t[x],count:e.rtCountSessions(y,t[x])}}t.sort(function(C,B){return B.count-C.count});r=k.filter(e.rtOnlyUniqueValues);for(x=0;x<r.length;x++){r[x]={value:r[x],count:e.rtCountSessions(y,r[x])}}r.sort(function(C,B){return B.count-C.count});j='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(o)+'"><div class="gadwp-bleft">'+e.i18n[0]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[0])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(w)+'"><div class="gadwp-bleft">'+e.i18n[1]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[1])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(t)+'"><div class="gadwp-bleft">'+e.i18n[2]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[2])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(r)+'"><div class="gadwp-bleft">'+e.i18n[3]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[3])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[4]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[0])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[5]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[1])+"</div></div>";document.getElementById("gadwp-tdo-right").innerHTML=j},throwDebug:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});if(j=="-24"){jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[15])}else{jQuery("#gadwp-reports"+b).css({"background-color":"#F7F7F7",height:"auto","margin-top":"10px","padding-top":"50px","padding-bottom":"50px",color:"#000","text-align":"center"});jQuery("#gadwp-reports"+b).html(j);jQuery("#gadwp-reports"+b).show();jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[11]);console.log("\n********************* GADWP Log ********************* \n\n"+j);a={action:"gadwp_set_error",response:j,gadwp_security_set_error:gadwpItemData.security};jQuery.post(gadwpItemData.ajaxurl,a)}},throwError:function(l,j,k){jQuery(l).css({"background-color":"#F7F7F7",height:"auto","padding-top":k,"padding-bottom":k,color:"#000","text-align":"center"});if(j==-21){jQuery(l).html(gadwpItemData.i18n[12]+" ("+j+")")}else{jQuery(l).html(gadwpItemData.i18n[13]+" ("+j+")")}},render:function(j,o,n){var k,q,p,l,m;if(o=="realtime"){jQuery("#gadwp-sel-report"+b).hide()}else{jQuery("#gadwp-sel-report"+b).show();clearInterval(e.rtRuns)}jQuery("#gadwp-status"+b).html("");switch(o){case"today":q="today";p="today";break;case"yesterday":q="yesterday";p="yesterday";break;case"7daysAgo":q="7daysAgo";p="yesterday";break;case"14daysAgo":q="14daysAgo";p="yesterday";break;case"90daysAgo":q="90daysAgo";p="yesterday";break;case"365daysAgo":q="365daysAgo";p="yesterday";break;case"1095daysAgo":q="1095daysAgo";p="yesterday";break;default:q="30daysAgo";p="yesterday";break}d.setCookie("default_metric",n);d.setCookie("default_dimension",o);if(typeof j!=="undefined"){d.setCookie("default_view",j);k=j}else{k=false}if(gadwpItemData.scope=="admin-item"){a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,from:q,to:p,filter:g}}else{if(gadwpItemData.scope=="front-item"){a={action:"gadwp_frontend_item_reports",gadwp_security_frontend_item_reports:gadwpItemData.security,from:q,to:p,filter:gadwpItemData.filter}}else{a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,projectId:k,from:q,to:p}}}if(o=="realtime"){e.i18n=gadwpItemData.i18n.slice(20,26);e.render.focusFlag=1;jQuery(window).bind("focus",function(r){e.render.focusFlag=1}).bind("blur",function(r){e.render.focusFlag=0});l='<div id="gadwp-realtime'+b+'">';l+='<div class="gadwp-rt-box">';l+='<div class="gadwp-tdo-left">';l+='<div class="gadwp-online" id="gadwp-online">0</div>';l+="</div>";l+='<div class="gadwp-tdo-right" id="gadwp-tdo-right">';l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[0]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[1]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[2]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[3]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[4]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[5]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+="</div>";l+="</div>";l+="<div>";l+='<div id="gadwp-pages" class="gadwp-pages"> </div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);e.rtRefresh(e.render.focusFlag);e.rtRuns=setInterval(e.rtRefresh,55000)}else{if(jQuery.inArray(n,["referrers","contentpages","searches"])>-1){l='<div id="gadwp-orgcharttablechart'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query="channelGrouping,"+n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartTableChart(r)})}else{if(n=="404errors"){l='<div id="gadwp-404tablechart'+b+'">';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.tableChart(r)})}else{if(n=="trafficdetails"||n=="technologydetails"){l='<div id="gadwp-orgchartpiecharts'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-1'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-2'+b+'" class="halfsize floatright"></div>';l+="</div>";l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-3'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-4'+b+'" class="halfsize floatright"></div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();if(n=="trafficdetails"){a.query="channelGrouping,medium,visitorType,source,socialNetwork";e.i18n=gadwpItemData.i18n.slice(0,5)}else{e.i18n=gadwpItemData.i18n.slice(15,20);a.query="deviceCategory,browser,operatingSystem,screenResolution,mobileDeviceBranding"}a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartPieCharts(r)})}else{if(n=="locations"){l='<div id="gadwp-geocharttablechart'+b+'">';l+='<div id="gadwp-geochart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.geoChartTableChart(r)})}else{l='<div id="gadwp-areachartbottomstats'+b+'">';l+='<div id="gadwp-areachart'+b+'"></div>';l+='<div id="gadwp-bottomstats'+b+'">';l+='<div class="inside">';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[5]+'</h3><p id="gdsessions'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[6]+'</h3><p id="gdusers'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[7]+'</h3><p id="gdpageviews'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[8]+'</h3><p id="gdbouncerate'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[9]+'</h3><p id="gdorganicsearch'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[10]+'</h3><p id="gdpagespervisit'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[26]+'</h3><p id="gdpagetime'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[27]+'</h3><p id="gdpageload'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[28]+'</h3><p id="gdsessionduration'+b+'"> </p></div>';l+="</div>";l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();a.query=n+",bottomstats";jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.areaChartBottomStats(r)})}}}}}},refresh:function(){if(jQuery("#gadwp-areachartbottomstats"+b).length>0&&jQuery.isArray(e.areaChartBottomStatsData)){e.areaChartBottomStats(e.areaChartBottomStatsData)}if(jQuery("#gadwp-orgchartpiecharts"+b).length>0&&jQuery.isArray(e.orgChartPieChartsData)){e.orgChartPieCharts(e.orgChartPieChartsData)}if(jQuery("#gadwp-geocharttablechart"+b).length>0&&jQuery.isArray(e.geoChartTableChartData)){e.geoChartTableChart(e.geoChartTableChartData)}if(jQuery("#gadwp-orgcharttablechart"+b).length>0&&jQuery.isArray(e.orgChartTableChartData)){e.orgChartTableChart(e.orgChartTableChartData)}if(jQuery("#gadwp-404tablechart"+b).length>0&&jQuery.isArray(e.tableChartData)){e.tableChart(e.tableChartData)}},init:function(){if(!jQuery("#gadwp-reports"+b).length){return}if(jQuery("#gadwp-reports"+b).html().length){return}try{NProgress.configure({parent:"#gadwp-progressbar"+b,showSpinner:false});NProgress.start()}catch(j){e.alertMessage(gadwpItemData.i18n[0])}e.render(jQuery("#gadwp-sel-view"+b).val(),jQuery("#gadwp-sel-period"+b).val(),jQuery("#gadwp-sel-report"+b).val());jQuery(window).resize(function(){var k=jQuery(window).width()-e.oldViewPort;if((k<-5)||(k>5)){e.oldViewPort=jQuery(window).width();e.refresh()}})}};h.init();e.init();jQuery("#gadwp-sel-view"+b).change(function(){jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-period"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-report"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("[id^=gadwp-swmetric-]").click(function(){c=this.id.replace("gadwp-swmetric-","");d.setCookie("default_swmetric",c);jQuery("#gadwp-swmetric-sessions").css("color","#444");jQuery("#gadwp-swmetric-users").css("color","#444");jQuery("#gadwp-swmetric-pageviews").css("color","#444");jQuery("#"+this.id).css("color","#008ec2");jQuery("#gadwp-reports"+b).html("");e.init()});if(gadwpItemData.scope=="admin-widgets"){return}else{return this.dialog({width:"auto",maxWidth:510,height:"auto",modal:true,fluid:true,dialogClass:"gadwp wp-dialog",resizable:false,title:e.getTitle(gadwpItemData.scope),position:{my:"top",at:"top+100",of:window}})}}});function GADWPReportLoad(){if(gadwpItemData.scope=="admin-widgets"){jQuery("#gadwp-window-1").gadwpItemReport(1)}else{jQuery(gadwpItemData.getSelector(gadwpItemData.scope)).click(function(){if(!jQuery("#gadwp-window-"+gadwpItemData.getID(this)).length>0){jQuery("body").append('<div id="gadwp-window-'+gadwpItemData.getID(this)+'"></div>')}jQuery("#gadwp-window-"+gadwpItemData.getID(this)).gadwpItemReport(gadwpItemData.getID(this))})}jQuery(window).resize(function(){gadwpItemData.responsiveDialog()});jQuery(document).on("dialogopen",".ui-dialog",function(a,b){gadwpItemData.responsiveDialog()})};
|
1 |
+
"use strict";if(gadwpItemData.mapsApiKey){google.charts.load("current",{mapsApiKey:gadwpItemData.mapsApiKey,packages:["corechart","table","orgchart","geochart"]})}else{google.charts.load("current",{packages:["corechart","table","orgchart","geochart"]})}google.charts.setOnLoadCallback(GADWPReportLoad);gadwpItemData.getID=function(a){if(gadwpItemData.scope=="admin-item"){if(typeof a.id=="undefined"){return 0}if(a.id.split("-")[1]=="undefined"){return 0}else{return a.id.split("-")[1]}}else{if(typeof a.id=="undefined"){return 1}if(a.id.split("-")[4]=="undefined"){return 1}else{return a.id.split("-")[4]}}};gadwpItemData.getSelector=function(a){if(a=="admin-item"){return'a[id^="gadwp-"]'}else{return'li[id^="wp-admin-bar-gadwp"] a'}};gadwpItemData.responsiveDialog=function(){var b,a,c;c=jQuery(".ui-dialog:visible");c.each(function(){b=jQuery(this).find(".ui-dialog-content").data("ui-dialog");if(b.options.fluid){a=jQuery(window).width();if(a<(parseInt(b.options.maxWidth)+50)){jQuery(this).css("max-width","90%")}else{jQuery(this).css("max-width",b.options.maxWidth+"px")}b.option("position",b.options.position)}})};jQuery.fn.extend({gadwpItemReport:function(g){var a,d,h,e,f,i,c,b="-"+g;d={setCookie:function(k,m){var j,l=new Date();if(gadwpItemData.scope=="admin-widgets"){k="gadwp_wg_"+k}else{k="gadwp_ir_"+k}l.setTime(l.getTime()+(24*60*60*1000*365));j="expires="+l.toUTCString();document.cookie=k+"="+m+"; "+j+"; path=/"},getCookie:function(j){var l,m,n,k=0;if(gadwpItemData.scope=="admin-widgets"){j="gadwp_wg_"+j+"="}else{j="gadwp_ir_"+j+"="}m=document.cookie.split(";");for(k=0;k<m.length;k++){l=m[k];while(l.charAt(0)==" "){l=l.substring(1)}if(l.indexOf(j)==0){return l.substring(j.length,l.length)}}return false},escape:function(j){div=document.createElement("div");div.appendChild(document.createTextNode(j));return div.innerHTML}};h={addOptions:function(o,n){var j,l,m,k=[];if(!d.getCookie("default_metric")||!d.getCookie("default_dimension")||!d.getCookie("default_swmetric")){j="sessions";l="30daysAgo";if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){c="pageviews"}else{c="sessions"}d.setCookie("default_metric",j);d.setCookie("default_dimension",l);d.setCookie("default_swmetric",c)}else{j=d.getCookie("default_metric");l=d.getCookie("default_dimension");m=d.getCookie("default_view");c=d.getCookie("default_swmetric")}if(n==false){if(gadwpItemData.scope=="front-item"||gadwpItemData.scope=="admin-item"){k=""}else{k='<span id="gadwp-swmetric-sessions" title="'+gadwpItemData.i18n[5]+'" class="dashicons dashicons-clock" style="font-size:22px;padding:4px;"></span>'}k+='<span id="gadwp-swmetric-users" title="'+gadwpItemData.i18n[6]+'" class="dashicons dashicons-admin-users" style="font-size:22px;padding:4px;"></span>';k+='<span id="gadwp-swmetric-pageviews" title="'+gadwpItemData.i18n[7]+'" class="dashicons dashicons-admin-page" style="font-size:22px;padding:4px;"></span>';jQuery(o).html(k);jQuery("#gadwp-swmetric-"+c).css("color","#008ec2")}else{jQuery.each(n,function(p,q){if(p==j||p==l||p==m){k.push('<option value="'+p+'" selected="selected">'+q+"</option>")}else{k.push('<option value="'+p+'">'+q+"</option>")}});jQuery(o).html(k.join(""))}},init:function(){var j;if(!jQuery("#gadwp-window"+b).length){return}if(jQuery("#gadwp-window"+b).html().length){return}j='<div id="gadwp-container'+b+'">';if(gadwpItemData.viewList!=false){j+='<select id="gadwp-sel-view'+b+'"></select>'}j+='<select id="gadwp-sel-period'+b+'"></select> ';j+='<select id="gadwp-sel-report'+b+'"></select>';j+='<div id="gadwp-sel-metric'+b+'" style="float:right;display:none;">';j+="</div>";j+='<div id="gadwp-progressbar'+b+'"></div>';j+='<div id="gadwp-status'+b+'"></div>';j+='<div id="gadwp-reports'+b+'"></div>';j+='<div style="text-align:right;width:100%;font-size:0.8em;clear:both;margin-right:5px;margin-top:10px;">';j+=gadwpItemData.i18n[14];j+=' <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_report&utm_medium=link&utm_content=back_report&utm_campaign=gadwp" rel="nofollow" style="text-decoration:none;font-size:1em;">GADWP</a> ';j+="</div>";j+="</div>",jQuery("#gadwp-window"+b).append(j);h.addOptions("#gadwp-sel-view"+b,gadwpItemData.viewList);h.addOptions("#gadwp-sel-period"+b,gadwpItemData.dateList);h.addOptions("#gadwp-sel-report"+b,gadwpItemData.reportList);h.addOptions("#gadwp-sel-metric"+b,false)}};e={oldViewPort:0,orgChartTableChartData:"",tableChartData:"",orgChartPieChartsData:"",geoChartTableChartData:"",areaChartBottomStatsData:"",realtime:"",rtRuns:null,i18n:null,getTitle:function(j){if(j=="admin-item"){return jQuery("#gadwp"+b).attr("title")}else{return document.getElementsByTagName("title")[0].innerHTML}},alertMessage:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});jQuery("#gadwp-status"+b).html(j)},areaChartBottomStats:function(j){e.areaChartBottomStatsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();if(a.query=="visitBounceRate,bottomstats"){e.drawAreaChart(j[0],true)}else{e.drawAreaChart(j[0],false)}}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-areachart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){jQuery("#gadwp-reports"+b).show();e.drawBottomStats(j[1])}else{e.throwDebug(j[1])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-bottomstats"+b,j[1],"40px")}}else{e.throwDebug(j)}NProgress.done()},orgChartPieCharts:function(j){var k=0;e.orgChartPieChartsData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}for(k=1;k<j.length;k++){if(!jQuery.isNumeric(j[k])){if(jQuery.isArray(j[k])){jQuery("#gadwp-reports"+b).show();e.drawPieChart("piechart-"+k,j[k],e.i18n[k])}else{e.throwDebug(j[k])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-piechart-"+k+b,j[k],"80px")}}}else{e.throwDebug(j)}NProgress.done()},geoChartTableChart:function(j){e.geoChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawGeoChart(j[0]);e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-geochart"+b,j[0],"125px");e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},orgChartTableChart:function(j){e.orgChartTableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawOrgChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-orgchart"+b,j[0],"125px")}if(!jQuery.isNumeric(j[1])){if(jQuery.isArray(j[1])){e.drawTableChart(j[1])}else{e.throwDebug(j[1])}}else{e.throwError("#gadwp-tablechart"+b,j[1],"125px")}}else{e.throwDebug(j)}NProgress.done()},tableChart:function(j){e.tableChartData=j;if(jQuery.isArray(j)){if(!jQuery.isNumeric(j[0])){if(jQuery.isArray(j[0])){jQuery("#gadwp-reports"+b).show();e.drawTableChart(j[0])}else{e.throwDebug(j[0])}}else{jQuery("#gadwp-reports"+b).show();e.throwError("#gadwp-tablechart"+b,j[0],"125px")}}else{e.throwDebug(j)}NProgress.done()},drawTableChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={page:"enable",pageSize:10,width:"100%",allowHtml:true};k=new google.visualization.Table(document.getElementById("gadwp-tablechart"+b));k.draw(l,j)},drawOrgChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={allowCollapse:true,allowHtml:true,height:"100%"};k=new google.visualization.OrgChart(document.getElementById("gadwp-orgchart"+b));k.draw(l,j)},drawPieChart:function(o,m,n){var l,j,k;l=google.visualization.arrayToDataTable(m);j={is3D:false,tooltipText:"percentage",legend:"none",chartArea:{width:"99%",height:"80%"},title:n,pieSliceText:"value",colors:gadwpItemData.colorVariations};k=new google.visualization.PieChart(document.getElementById("gadwp-"+o+b));k.draw(l,j)},drawGeoChart:function(m){var l,j,k;l=google.visualization.arrayToDataTable(m);j={chartArea:{width:"99%",height:"90%"},colors:[gadwpItemData.colorVariations[5],gadwpItemData.colorVariations[4]]};if(gadwpItemData.region){j.region=gadwpItemData.region;j.displayMode="markers";j.datalessRegionColor="EFEFEF"}k=new google.visualization.GeoChart(document.getElementById("gadwp-geochart"+b));k.draw(l,j)},drawAreaChart:function(n,o){var m,j,l,k;m=google.visualization.arrayToDataTable(n);if(o){k=new google.visualization.NumberFormat({suffix:"%",fractionDigits:2});k.format(m,1)}j={legend:{position:"none"},pointSize:3,colors:[gadwpItemData.colorVariations[0],gadwpItemData.colorVariations[4]],chartArea:{width:"99%",height:"90%"},vAxis:{textPosition:"in",minValue:0},hAxis:{textPosition:"none"}};l=new google.visualization.AreaChart(document.getElementById("gadwp-areachart"+b));l.draw(m,j)},drawBottomStats:function(j){jQuery("#gdsessions"+b).html(j[0]);jQuery("#gdusers"+b).html(j[1]);jQuery("#gdpageviews"+b).html(j[2]);jQuery("#gdbouncerate"+b).html(j[3]);jQuery("#gdorganicsearch"+b).html(j[4]);jQuery("#gdpagespervisit"+b).html(j[5]);jQuery("#gdpagetime"+b).html(j[6]);jQuery("#gdpageload"+b).html(j[7]);jQuery("#gdsessionduration"+b).html(j[8])},rtOnlyUniqueValues:function(l,k,j){return j.indexOf(l)===k},rtCountSessions:function(k,m){var l=0,j=0;for(j=0;j<k.rows.length;j++){if(jQuery.inArray(m,k.rows[j])>-1){l+=parseInt(k.rows[j][6])}}return l},rtGenerateTooltip:function(k){var m=0,l="",j=0;for(j=0;j<k.length;j++){m+=parseInt(k[j].count);l+="<tr><td class='gadwp-pgdetailsl'>"+k[j].value+"</td><td class='gadwp-pgdetailsr'>"+k[j].count+"</td></tr>"}if(m){return("<table>"+l+"</table>")}else{return("")}},rtPageDetails:function(y,n){var w,o,r,x=0,v=0,m=0,s=0,t=0,z=0,C=0,q=0,l=0,u="",A="",p="",k="",B="";y=y.rows;for(x=0;x<y.length;x++){if(y[x][0]==n){o=y[x][5];switch(y[x][3]){case"REFERRAL":t+=parseInt(y[x][6]);u+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"ORGANIC":z+=parseInt(y[x][6]);A+="<tr><td class='gadwp-pgdetailsl'>"+y[x][2]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"SOCIAL":q+=parseInt(y[x][6]);p+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"CUSTOM":l+=parseInt(y[x][6]);k+="<tr><td class='gadwp-pgdetailsl'>"+y[x][1]+"</td><td class='gadwp-pgdetailsr'>"+y[x][6]+"</td></tr>";break;case"DIRECT":C+=parseInt(y[x][6]);break}}}if(t){u="<table><tr><td>"+e.i18n[0]+"("+t+")</td></tr>"+u+"</table><br />"}if(z){A="<table><tr><td>"+e.i18n[1]+"("+z+")</td></tr>"+A+"</table><br />"}if(q){p="<table><tr><td>"+e.i18n[2]+"("+q+")</td></tr>"+p+"</table><br />"}if(l){k="<table><tr><td>"+e.i18n[3]+"("+l+")</td></tr>"+k+"</table><br />"}if(C){B="<table><tr><td>"+e.i18n[4]+"("+C+")</td></tr></table><br />"}return("<p><center><strong>"+o+"</strong></center></p>"+u+A+p+k+B)},rtRefresh:function(){if(e.render.focusFlag){a.from=false;a.to=false;a.query="realtime";jQuery.post(gadwpItemData.ajaxurl,a,function(j){if(jQuery.isArray(j)){jQuery("#gadwp-reports"+b).show();e.realtime=j[0];e.drawRealtime(e.realtime)}else{e.throwDebug(j)}NProgress.done()})}},drawRealtime:function(y){var j,n,o,w,t,r,x=0,v=[],z=[],p=[],m=[],q=[],k=[],l=[],s="",o=[],w=[],t=[],r=[],u=["REFERRAL","ORGANIC","SOCIAL","CUSTOM"],A=["DIRECT","NEW"];jQuery(function(){jQuery("#gadwp-widget *").tooltip({tooltipClass:"gadwp"})});y=y[0];if(jQuery.isNumeric(y)||typeof y==="undefined"){y=[];y.totalsForAllResults=[];y.totalsForAllResults["rt:activeUsers"]="0";y.rows=[]}if(y.totalsForAllResults["rt:activeUsers"]!==document.getElementById("gadwp-online").innerHTML){jQuery("#gadwp-online").fadeOut("slow");jQuery("#gadwp-online").fadeOut(500);jQuery("#gadwp-online").fadeOut("slow",function(){if((parseInt(y.totalsForAllResults["rt:activeUsers"]))<(parseInt(document.getElementById("gadwp-online").innerHTML))){jQuery("#gadwp-online").css({"background-color":"#FFE8E8"})}else{jQuery("#gadwp-online").css({"background-color":"#E0FFEC"})}document.getElementById("gadwp-online").innerHTML=y.totalsForAllResults["rt:activeUsers"]});jQuery("#gadwp-online").fadeIn("slow");jQuery("#gadwp-online").fadeIn(500);jQuery("#gadwp-online").fadeIn("slow",function(){jQuery("#gadwp-online").css({"background-color":"#FFFFFF"})})}if(y.totalsForAllResults["rt:activeUsers"]==0){y.rows=[]}for(x=0;x<y.rows.length;x++){v.push(y.rows[x][0]);if(y.rows[x][3]=="REFERRAL"){z.push(y.rows[x][1])}if(y.rows[x][3]=="ORGANIC"){p.push(y.rows[x][2])}if(y.rows[x][3]=="SOCIAL"){m.push(y.rows[x][1])}if(y.rows[x][3]=="CUSTOM"){k.push(y.rows[x][1])}q.push(y.rows[x][3])}n=v.filter(e.rtOnlyUniqueValues);for(x=0;x<n.length;x++){l[x]={pagepath:n[x],count:e.rtCountSessions(y,n[x])}}l.sort(function(C,B){return B.count-C.count});s="";for(x=0;x<l.length;x++){if(x<gadwpItemData.rtLimitPages){s+='<div class="gadwp-pline"><div class="gadwp-pleft"><a href="#" data-gadwp="'+e.rtPageDetails(y,l[x].pagepath)+'">'+l[x].pagepath.substring(0,70)+'</a></div><div class="gadwp-pright">'+l[x].count+"</div></div>"}}document.getElementById("gadwp-pages").innerHTML='<br /><div class="gadwp-pg">'+s+"</div>";o=z.filter(e.rtOnlyUniqueValues);for(x=0;x<o.length;x++){o[x]={value:o[x],count:e.rtCountSessions(y,o[x])}}o.sort(function(C,B){return B.count-C.count});w=p.filter(e.rtOnlyUniqueValues);for(x=0;x<w.length;x++){w[x]={value:w[x],count:e.rtCountSessions(y,w[x])}}w.sort(function(C,B){return B.count-C.count});t=m.filter(e.rtOnlyUniqueValues);for(x=0;x<t.length;x++){t[x]={value:t[x],count:e.rtCountSessions(y,t[x])}}t.sort(function(C,B){return B.count-C.count});r=k.filter(e.rtOnlyUniqueValues);for(x=0;x<r.length;x++){r[x]={value:r[x],count:e.rtCountSessions(y,r[x])}}r.sort(function(C,B){return B.count-C.count});j='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(o)+'"><div class="gadwp-bleft">'+e.i18n[0]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[0])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(w)+'"><div class="gadwp-bleft">'+e.i18n[1]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[1])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(t)+'"><div class="gadwp-bleft">'+e.i18n[2]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[2])+"</div></div>";j+='<div class="gadwp-bigtext"><a href="#" data-gadwp="'+e.rtGenerateTooltip(r)+'"><div class="gadwp-bleft">'+e.i18n[3]+'</a></div><div class="gadwp-bright">'+e.rtCountSessions(y,u[3])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[4]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[0])+"</div></div>";j+='<div class="gadwp-bigtext"><div class="gadwp-bleft">'+e.i18n[5]+'</div><div class="gadwp-bright">'+e.rtCountSessions(y,A[1])+"</div></div>";document.getElementById("gadwp-tdo-right").innerHTML=j},throwDebug:function(j){jQuery("#gadwp-status"+b).css({"margin-top":"3px","padding-left":"5px",height:"auto",color:"#000","border-left":"5px solid red"});if(j=="-24"){jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[15])}else{jQuery("#gadwp-reports"+b).css({"background-color":"#F7F7F7",height:"auto","margin-top":"10px","padding-top":"50px","padding-bottom":"50px",color:"#000","text-align":"center"});jQuery("#gadwp-reports"+b).html(j);jQuery("#gadwp-reports"+b).show();jQuery("#gadwp-status"+b).html(gadwpItemData.i18n[11]);console.log("\n********************* GADWP Log ********************* \n\n"+j);a={action:"gadwp_set_error",response:j,gadwp_security_set_error:gadwpItemData.security};jQuery.post(gadwpItemData.ajaxurl,a)}},throwError:function(l,j,k){jQuery(l).css({"background-color":"#F7F7F7",height:"auto","padding-top":k,"padding-bottom":k,color:"#000","text-align":"center"});if(j==-21){jQuery(l).html(gadwpItemData.i18n[12])}else{jQuery(l).html(gadwpItemData.i18n[13]+" ("+j+")")}},render:function(j,o,n){var k,q,p,l,m;if(o=="realtime"){jQuery("#gadwp-sel-report"+b).hide()}else{jQuery("#gadwp-sel-report"+b).show();clearInterval(e.rtRuns)}jQuery("#gadwp-status"+b).html("");switch(o){case"today":q="today";p="today";break;case"yesterday":q="yesterday";p="yesterday";break;case"7daysAgo":q="7daysAgo";p="yesterday";break;case"14daysAgo":q="14daysAgo";p="yesterday";break;case"90daysAgo":q="90daysAgo";p="yesterday";break;case"365daysAgo":q="365daysAgo";p="yesterday";break;case"1095daysAgo":q="1095daysAgo";p="yesterday";break;default:q="30daysAgo";p="yesterday";break}d.setCookie("default_metric",n);d.setCookie("default_dimension",o);if(typeof j!=="undefined"){d.setCookie("default_view",j);k=j}else{k=false}if(gadwpItemData.scope=="admin-item"){a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,from:q,to:p,filter:g}}else{if(gadwpItemData.scope=="front-item"){a={action:"gadwp_frontend_item_reports",gadwp_security_frontend_item_reports:gadwpItemData.security,from:q,to:p,filter:gadwpItemData.filter}}else{a={action:"gadwp_backend_item_reports",gadwp_security_backend_item_reports:gadwpItemData.security,projectId:k,from:q,to:p}}}if(o=="realtime"){e.i18n=gadwpItemData.i18n.slice(20,26);e.render.focusFlag=1;jQuery(window).bind("focus",function(r){e.render.focusFlag=1}).bind("blur",function(r){e.render.focusFlag=0});l='<div id="gadwp-realtime'+b+'">';l+='<div class="gadwp-rt-box">';l+='<div class="gadwp-tdo-left">';l+='<div class="gadwp-online" id="gadwp-online">0</div>';l+="</div>";l+='<div class="gadwp-tdo-right" id="gadwp-tdo-right">';l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[0]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[1]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[2]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[3]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[4]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+='<div class="gadwp-bigtext">';l+='<div class="gadwp-bleft">'+e.i18n[5]+"</div>";l+='<div class="gadwp-bright">0</div>';l+="</div>";l+="</div>";l+="</div>";l+="<div>";l+='<div id="gadwp-pages" class="gadwp-pages"> </div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);e.rtRefresh(e.render.focusFlag);e.rtRuns=setInterval(e.rtRefresh,55000)}else{if(jQuery.inArray(n,["referrers","contentpages","searches"])>-1){l='<div id="gadwp-orgcharttablechart'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query="channelGrouping,"+n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartTableChart(r)})}else{if(n=="404errors"){l='<div id="gadwp-404tablechart'+b+'">';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.tableChart(r)})}else{if(n=="trafficdetails"||n=="technologydetails"){l='<div id="gadwp-orgchartpiecharts'+b+'">';l+='<div id="gadwp-orgchart'+b+'"></div>';l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-1'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-2'+b+'" class="halfsize floatright"></div>';l+="</div>";l+='<div class="gadwp-floatwraper">';l+='<div id="gadwp-piechart-3'+b+'" class="halfsize floatleft"></div>';l+='<div id="gadwp-piechart-4'+b+'" class="halfsize floatright"></div>';l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();if(n=="trafficdetails"){a.query="channelGrouping,medium,visitorType,source,socialNetwork";e.i18n=gadwpItemData.i18n.slice(0,5)}else{e.i18n=gadwpItemData.i18n.slice(15,20);a.query="deviceCategory,browser,operatingSystem,screenResolution,mobileDeviceBranding"}a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.orgChartPieCharts(r)})}else{if(n=="locations"){l='<div id="gadwp-geocharttablechart'+b+'">';l+='<div id="gadwp-geochart'+b+'"></div>';l+='<div id="gadwp-tablechart'+b+'"></div>';l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();jQuery("#gadwp-sel-metric"+b).show();a.query=n;a.metric=c;jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.geoChartTableChart(r)})}else{l='<div id="gadwp-areachartbottomstats'+b+'">';l+='<div id="gadwp-areachart'+b+'"></div>';l+='<div id="gadwp-bottomstats'+b+'">';l+='<div class="inside">';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[5]+'</h3><p id="gdsessions'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[6]+'</h3><p id="gdusers'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[7]+'</h3><p id="gdpageviews'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[8]+'</h3><p id="gdbouncerate'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[9]+'</h3><p id="gdorganicsearch'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[10]+'</h3><p id="gdpagespervisit'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[26]+'</h3><p id="gdpagetime'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[27]+'</h3><p id="gdpageload'+b+'"> </p></div>';l+='<div class="small-box"><h3>'+gadwpItemData.i18n[28]+'</h3><p id="gdsessionduration'+b+'"> </p></div>';l+="</div>";l+="</div>";l+="</div>";jQuery("#gadwp-reports"+b).html(l);jQuery("#gadwp-reports"+b).hide();a.query=n+",bottomstats";jQuery.post(gadwpItemData.ajaxurl,a,function(r){e.areaChartBottomStats(r)})}}}}}},refresh:function(){if(jQuery("#gadwp-areachartbottomstats"+b).length>0&&jQuery.isArray(e.areaChartBottomStatsData)){e.areaChartBottomStats(e.areaChartBottomStatsData)}if(jQuery("#gadwp-orgchartpiecharts"+b).length>0&&jQuery.isArray(e.orgChartPieChartsData)){e.orgChartPieCharts(e.orgChartPieChartsData)}if(jQuery("#gadwp-geocharttablechart"+b).length>0&&jQuery.isArray(e.geoChartTableChartData)){e.geoChartTableChart(e.geoChartTableChartData)}if(jQuery("#gadwp-orgcharttablechart"+b).length>0&&jQuery.isArray(e.orgChartTableChartData)){e.orgChartTableChart(e.orgChartTableChartData)}if(jQuery("#gadwp-404tablechart"+b).length>0&&jQuery.isArray(e.tableChartData)){e.tableChart(e.tableChartData)}},init:function(){if(!jQuery("#gadwp-reports"+b).length){return}if(jQuery("#gadwp-reports"+b).html().length){return}try{NProgress.configure({parent:"#gadwp-progressbar"+b,showSpinner:false});NProgress.start()}catch(j){e.alertMessage(gadwpItemData.i18n[0])}e.render(jQuery("#gadwp-sel-view"+b).val(),jQuery("#gadwp-sel-period"+b).val(),jQuery("#gadwp-sel-report"+b).val());jQuery(window).resize(function(){var k=jQuery(window).width()-e.oldViewPort;if((k<-5)||(k>5)){e.oldViewPort=jQuery(window).width();e.refresh()}})}};h.init();e.init();jQuery("#gadwp-sel-view"+b).change(function(){jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-period"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("#gadwp-sel-report"+b).change(function(){jQuery("#gadwp-sel-metric"+b).hide();jQuery("#gadwp-reports"+b).html("");e.init()});jQuery("[id^=gadwp-swmetric-]").click(function(){c=this.id.replace("gadwp-swmetric-","");d.setCookie("default_swmetric",c);jQuery("#gadwp-swmetric-sessions").css("color","#444");jQuery("#gadwp-swmetric-users").css("color","#444");jQuery("#gadwp-swmetric-pageviews").css("color","#444");jQuery("#"+this.id).css("color","#008ec2");jQuery("#gadwp-reports"+b).html("");e.init()});if(gadwpItemData.scope=="admin-widgets"){return}else{return this.dialog({width:"auto",maxWidth:510,height:"auto",modal:true,fluid:true,dialogClass:"gadwp wp-dialog",resizable:false,title:e.getTitle(gadwpItemData.scope),position:{my:"top",at:"top+100",of:window}})}}});function GADWPReportLoad(){if(gadwpItemData.scope=="admin-widgets"){jQuery("#gadwp-window-1").gadwpItemReport(1)}else{jQuery(gadwpItemData.getSelector(gadwpItemData.scope)).click(function(){if(!jQuery("#gadwp-window-"+gadwpItemData.getID(this)).length>0){jQuery("body").append('<div id="gadwp-window-'+gadwpItemData.getID(this)+'"></div>')}jQuery("#gadwp-window-"+gadwpItemData.getID(this)).gadwpItemReport(gadwpItemData.getID(this))})}jQuery(window).resize(function(){gadwpItemData.responsiveDialog()});jQuery(document).on("dialogopen",".ui-dialog",function(a,b){gadwpItemData.responsiveDialog()})};
|
config.php
CHANGED
@@ -47,7 +47,7 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
47 |
}
|
48 |
if ( isset( $item['slug'] ) && 'google-analytics-dashboard-for-wp' == $item['slug'] ) {
|
49 |
// Only when a minor update is available
|
50 |
-
if ($this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] )){
|
51 |
update_option( 'gadwp_got_updated', true );
|
52 |
return ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) );
|
53 |
}
|
@@ -89,6 +89,8 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
89 |
'ga_dash_excludesa',
|
90 |
'ga_pagescrolldepth_tracking',
|
91 |
'tm_pagescrolldepth_tracking',
|
|
|
|
|
92 |
);
|
93 |
foreach ( $numerics as $key ) {
|
94 |
if ( isset( $options[$key] ) ) {
|
@@ -136,6 +138,10 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
136 |
$options['ga_speed_samplerate'] = 1;
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
139 |
if ( isset( $options['ga_cookieexpires'] ) && $options['ga_cookieexpires'] ) { // v4.9
|
140 |
$options['ga_cookieexpires'] = (int) $options['ga_cookieexpires'];
|
141 |
}
|
@@ -291,6 +297,11 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
291 |
$this->options['frontend_item_reports'] = $this->options['ga_dash_frontend_stats'];
|
292 |
}
|
293 |
|
|
|
|
|
|
|
|
|
|
|
294 |
$unsets = array( 'ga_dash_jailadmins', // v4.7
|
295 |
'ga_tracking_code',
|
296 |
'ga_dash_tableid', // v4.9
|
@@ -362,6 +373,10 @@ if ( ! class_exists( 'GADWP_Config' ) ) {
|
|
362 |
$flag = true;
|
363 |
}
|
364 |
|
|
|
|
|
|
|
|
|
365 |
if ( ! isset( $this->options['ga_event_downloads'] ) ) {
|
366 |
$this->options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
|
367 |
$flag = true;
|
47 |
}
|
48 |
if ( isset( $item['slug'] ) && 'google-analytics-dashboard-for-wp' == $item['slug'] ) {
|
49 |
// Only when a minor update is available
|
50 |
+
if ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) ) {
|
51 |
update_option( 'gadwp_got_updated', true );
|
52 |
return ( $this->get_major_version( GADWP_CURRENT_VERSION ) == $this->get_major_version( $item['new_version'] ) );
|
53 |
}
|
89 |
'ga_dash_excludesa',
|
90 |
'ga_pagescrolldepth_tracking',
|
91 |
'tm_pagescrolldepth_tracking',
|
92 |
+
'ga_speed_samplerate',
|
93 |
+
'ga_user_samplerate',
|
94 |
);
|
95 |
foreach ( $numerics as $key ) {
|
96 |
if ( isset( $options[$key] ) ) {
|
138 |
$options['ga_speed_samplerate'] = 1;
|
139 |
}
|
140 |
|
141 |
+
if ( isset( $options['ga_user_samplerate'] ) && ( $options['ga_user_samplerate'] < 1 || $options['ga_user_samplerate'] > 100 ) ) {
|
142 |
+
$options['ga_user_samplerate'] = 100;
|
143 |
+
}
|
144 |
+
|
145 |
if ( isset( $options['ga_cookieexpires'] ) && $options['ga_cookieexpires'] ) { // v4.9
|
146 |
$options['ga_cookieexpires'] = (int) $options['ga_cookieexpires'];
|
147 |
}
|
297 |
$this->options['frontend_item_reports'] = $this->options['ga_dash_frontend_stats'];
|
298 |
}
|
299 |
|
300 |
+
if ( isset($this->options['ga_dash_tracking']) && 0 == $this->options['ga_dash_tracking'] ) { // v5.0.1
|
301 |
+
$this->options['ga_dash_tracking_type'] = 'disabled';
|
302 |
+
$flag = true;
|
303 |
+
}
|
304 |
+
|
305 |
$unsets = array( 'ga_dash_jailadmins', // v4.7
|
306 |
'ga_tracking_code',
|
307 |
'ga_dash_tableid', // v4.9
|
373 |
$flag = true;
|
374 |
}
|
375 |
|
376 |
+
if ( ! isset( $this->options['ga_user_samplerate'] ) ) {
|
377 |
+
$this->options['ga_user_samplerate'] = 100;
|
378 |
+
}
|
379 |
+
|
380 |
if ( ! isset( $this->options['ga_event_downloads'] ) ) {
|
381 |
$this->options['ga_event_downloads'] = 'zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*';
|
382 |
$flag = true;
|
front/js/tracking-analytics-events.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";var gadwpRedirectLink;var gadwpRedirectCalled=false;var gadwpDefaultPrevented=false;function gadwpRedirect(){if(gadwpRedirectCalled){return}gadwpRedirectCalled=true;if(!gadwpDefaultPrevented){document.location.href=gadwpRedirectLink}else{gadwpDefaultPrevented=false}}(
|
1 |
+
"use strict";var gadwpRedirectLink;var gadwpRedirectCalled=false;var gadwpDefaultPrevented=false;function gadwpRedirect(){if(gadwpRedirectCalled){return}gadwpRedirectCalled=true;if(!gadwpDefaultPrevented){document.location.href=gadwpRedirectLink}else{gadwpDefaultPrevented=false}}jQuery(window).on("load",function(){if(gadwpUAEventsData.options.event_tracking){jQuery("a").filter(function(){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$");return this.href.match(a)}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"download";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});jQuery('a[href^="mailto"]').click(function(d){var b=this.getAttribute("data-vars-ga-category")||"email";var c=this.getAttribute("data-vars-ga-action")||"send";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});jQuery('a[href^="tel"]').click(function(d){if(gadwpUAEventsData.options.event_bouncerate){var b=this.getAttribute("data-vars-ga-category")||"telephone";var c=this.getAttribute("data-vars-ga-action")||"call";var a=this.getAttribute("data-vars-ga-label")||this.href;ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}});if(gadwpUAEventsData.options.root_domain){jQuery('a[href^="http"]').filter(function(){var a=new RegExp(".*\\.("+gadwpUAEventsData.options.event_downloads+")(\\?.*)?$");if(!this.href.match(a)){if(this.href.indexOf(gadwpUAEventsData.options.root_domain)==-1){return this.href}}}).click(function(d){gadwpRedirectCalled=false;gadwpRedirectLink=this.href;var b=this.getAttribute("data-vars-ga-category")||"outbound";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1,hitCallback:gadwpRedirect})}else{ga("send","event",b,c,a,{hitCallback:gadwpRedirect})}if(this.target!="_blank"){if(d.isDefaultPrevented()){gadwpDefaultPrevented=true}setTimeout(gadwpRedirect,gadwpUAEventsData.options.event_timeout);return false}else{gadwpRedirectCalled=true}})}}if(gadwpUAEventsData.options.event_affiliates&&gadwpUAEventsData.options.aff_tracking){jQuery("a").filter(function(){if(gadwpUAEventsData.options.event_affiliates!=""){var a=new RegExp("("+gadwpUAEventsData.options.event_affiliates.replace(/\//g,"/")+")");return this.href.match(a)}}).click(function(c){gadwpRedirectCalled=false;gadwpRedirectLink=this.href;var b=this.getAttribute("data-vars-ga-category")||"affiliates";var d=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,d,a,{nonInteraction:1,hitCallback:gadwpRedirect})}else{ga("send","event",b,d,a,{hitCallback:gadwpRedirect})}if(this.target!="_blank"){if(e.isDefaultPrevented()){gadwpDefaultPrevented=true}setTimeout(gadwpRedirect,gadwpUAEventsData.options.event_timeout);return false}else{gadwpRedirectCalled=true}})}if(gadwpUAEventsData.options.root_domain&&gadwpUAEventsData.options.hash_tracking){jQuery("a").filter(function(){if(this.href.indexOf(gadwpUAEventsData.options.root_domain)!=-1||this.href.indexOf("://")==-1){return this.hash}}).click(function(d){var b=this.getAttribute("data-vars-ga-category")||"hashmark";var c=this.getAttribute("data-vars-ga-action")||"click";var a=this.getAttribute("data-vars-ga-label")||this.href;if(gadwpUAEventsData.options.event_bouncerate){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}})}if(gadwpUAEventsData.options.event_formsubmit){jQuery('input[type="submit"]').click(function(f){var d=this;var b=d.getAttribute("data-vars-ga-category")||"form";var c=d.getAttribute("data-vars-ga-action")||"submit";var a=d.getAttribute("data-vars-ga-label")||d.name||d.value;if(gadwpUAEventsData.options.event_formsubmit){ga("send","event",b,c,a,{nonInteraction:1})}else{ga("send","event",b,c,a)}})}if(gadwpUAEventsData.options.ga_pagescrolldepth_tracking){jQuery.scrollDepth({percentage:true,userTiming:false,pixelDepth:false,gtmOverride:true,nonInteraction:gadwpUAEventsData.options.event_bouncerate})}});
|
front/js/tracking-tagmanager-events.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(
|
1 |
+
jQuery(window).on("load",function(){jQuery.scrollDepth({percentage:true,userTiming:false,pixelDepth:false,gtmOverride:false})});
|
front/setup.php
CHANGED
@@ -98,7 +98,7 @@ if ( ! class_exists( 'GADWP_Frontend_Setup' ) ) {
|
|
98 |
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
|
99 |
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
|
100 |
__( "Invalid response", 'google-analytics-dashboard-for-wp' ),
|
101 |
-
__( "
|
102 |
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
|
103 |
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
|
104 |
__( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <strong>' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</strong>!',
|
98 |
__( "Organic Search", 'google-analytics-dashboard-for-wp' ),
|
99 |
__( "Pages/Session", 'google-analytics-dashboard-for-wp' ),
|
100 |
__( "Invalid response", 'google-analytics-dashboard-for-wp' ),
|
101 |
+
__( "No Data", 'google-analytics-dashboard-for-wp' ),
|
102 |
__( "This report is unavailable", 'google-analytics-dashboard-for-wp' ),
|
103 |
__( "report generated by", 'google-analytics-dashboard-for-wp' ), //14
|
104 |
__( "This plugin needs an authorization:", 'google-analytics-dashboard-for-wp' ) . ' <strong>' . __( "authorize the plugin", 'google-analytics-dashboard-for-wp' ) . '</strong>!',
|
front/tracking-analytics.php
CHANGED
@@ -11,15 +11,13 @@
|
|
11 |
if ( ! defined( 'ABSPATH' ) )
|
12 |
exit();
|
13 |
|
14 |
-
if ( ! class_exists( '
|
15 |
-
|
16 |
-
class GADWP_Tracking_Analytics {
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
|
22 |
-
|
23 |
|
24 |
public function __construct() {
|
25 |
$this->gadwp = GADWP();
|
@@ -27,6 +25,85 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
27 |
$profile = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_dash_profile_list'], $this->gadwp->config->options['ga_dash_tableid_jail'] );
|
28 |
|
29 |
$this->uaid = esc_html( $profile[2] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
$this->load_scripts();
|
32 |
|
@@ -39,11 +116,6 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
39 |
} else {
|
40 |
add_action( 'wp_head', array( $this, 'output' ), 99 );
|
41 |
}
|
42 |
-
|
43 |
-
if ( $this->gadwp->config->options['amp_tracking_analytics'] ) {
|
44 |
-
add_action( 'amp_post_template_head', array( $this, 'amp_add_analytics_script' ) );
|
45 |
-
add_action( 'amp_post_template_footer', array( $this, 'amp_output' ) );
|
46 |
-
}
|
47 |
}
|
48 |
|
49 |
/**
|
@@ -76,7 +148,7 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
76 |
* Styles & Scripts load
|
77 |
*/
|
78 |
private function load_scripts() {
|
79 |
-
if ( $this->gadwp->config->options['ga_event_tracking'] || $this->gadwp->config->options['ga_aff_tracking'] || $this->gadwp->config->options['ga_hash_tracking'] || $this->gadwp->config->options['ga_pagescrolldepth_tracking'] ) {
|
80 |
|
81 |
$root_domain = GADWP_Tools::get_root_domain();
|
82 |
|
@@ -143,6 +215,9 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
143 |
if ( 1 != $this->gadwp->config->options['ga_speed_samplerate'] ) {
|
144 |
$fieldsobject['siteSpeedSampleRate'] = (int) $this->gadwp->config->options['ga_speed_samplerate'];
|
145 |
}
|
|
|
|
|
|
|
146 |
if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
|
147 |
$fieldsobject['allowLinker'] = 'true';
|
148 |
}
|
@@ -186,77 +261,16 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
186 |
$this->add( 'require', $fields );
|
187 |
}
|
188 |
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
$fields['value'] = esc_attr( $author_name );
|
196 |
-
$this->add( 'set', $fields );
|
197 |
-
}
|
198 |
-
|
199 |
-
if ( $this->gadwp->config->options['ga_pubyear_dimindex'] && is_single() ) {
|
200 |
-
$fields = array();
|
201 |
-
global $post;
|
202 |
-
$date = get_the_date( 'Y', $post->ID );
|
203 |
-
$fields['dimension'] = 'dimension' . (int) $this->gadwp->config->options['ga_pubyear_dimindex'];
|
204 |
-
$fields['value'] = (int) $date;
|
205 |
-
$this->add( 'set', $fields );
|
206 |
-
}
|
207 |
-
|
208 |
-
if ( $this->gadwp->config->options['ga_pubyearmonth_dimindex'] && is_single() ) {
|
209 |
-
$fields = array();
|
210 |
-
global $post;
|
211 |
-
$date = get_the_date( 'Y-m', $post->ID );
|
212 |
-
$fields['dimension'] = 'dimension' . (int) $this->gadwp->config->options['ga_pubyearmonth_dimindex'];
|
213 |
-
$fields['value'] = esc_attr( $date );
|
214 |
-
$this->add( 'set', $fields );
|
215 |
-
}
|
216 |
-
|
217 |
-
if ( $this->gadwp->config->options['ga_category_dimindex'] && is_category() ) {
|
218 |
-
$fields = array();
|
219 |
-
$fields['dimension'] = 'dimension' . (int) $this->gadwp->config->options['ga_category_dimindex'];
|
220 |
-
$fields['value'] = esc_attr( single_tag_title( '', false ) );
|
221 |
-
$this->add( 'set', $fields );
|
222 |
-
}
|
223 |
-
if ( $this->gadwp->config->options['ga_category_dimindex'] && is_single() ) {
|
224 |
-
$fields = array();
|
225 |
-
global $post;
|
226 |
-
$categories = get_the_category( $post->ID );
|
227 |
-
foreach ( $categories as $category ) {
|
228 |
-
$fields['dimension'] = 'dimension' . (int) $this->gadwp->config->options['ga_category_dimindex'];
|
229 |
-
$fields['value'] = esc_attr( $category->name );
|
230 |
-
$this->add( 'set', $fields );
|
231 |
-
break;
|
232 |
-
}
|
233 |
-
}
|
234 |
-
|
235 |
-
if ( $this->gadwp->config->options['ga_tag_dimindex'] && is_single() ) {
|
236 |
-
global $post;
|
237 |
-
$fields = array();
|
238 |
-
$post_tags_list = '';
|
239 |
-
$post_tags_array = get_the_tags( $post->ID );
|
240 |
-
if ( $post_tags_array ) {
|
241 |
-
foreach ( $post_tags_array as $tag ) {
|
242 |
-
$post_tags_list .= $tag->name . ', ';
|
243 |
-
}
|
244 |
-
}
|
245 |
-
$post_tags_list = rtrim( $post_tags_list, ', ' );
|
246 |
-
if ( $post_tags_list ) {
|
247 |
-
$fields['dimension'] = 'dimension' . (int) $this->gadwp->config->options['ga_tag_dimindex'];
|
248 |
-
$fields['value'] = esc_attr( $post_tags_list );
|
249 |
$this->add( 'set', $fields );
|
250 |
}
|
251 |
}
|
252 |
|
253 |
-
if ( $this->gadwp->config->options['ga_user_dimindex'] ) {
|
254 |
-
$fields = array();
|
255 |
-
$fields['dimension'] = 'dimension' . (int) $this->gadwp->config->options['ga_user_dimindex'];
|
256 |
-
$fields['value'] = is_user_logged_in() ? 'registered' : 'guest';
|
257 |
-
$this->add( 'set', $fields );
|
258 |
-
}
|
259 |
-
|
260 |
if ( $this->gadwp->config->options['ga_dash_anonim'] ) {
|
261 |
$fields = array();
|
262 |
$fields['option'] = 'anonymizeIp';
|
@@ -330,19 +344,158 @@ if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
|
330 |
|
331 |
GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode ) );
|
332 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
|
334 |
/**
|
335 |
* Inserts the Analytics AMP script in the head section
|
336 |
*/
|
337 |
-
public function
|
338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
}
|
340 |
|
341 |
/**
|
342 |
* Outputs the Google Analytics tracking code for AMP
|
343 |
*/
|
344 |
-
public function
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
}
|
347 |
}
|
348 |
}
|
11 |
if ( ! defined( 'ABSPATH' ) )
|
12 |
exit();
|
13 |
|
14 |
+
if ( ! class_exists( 'GADWP_Tracking_Analytics_Base' ) ) {
|
|
|
|
|
15 |
|
16 |
+
class GADWP_Tracking_Analytics_Base {
|
17 |
|
18 |
+
protected $gadwp;
|
19 |
|
20 |
+
protected $uaid;
|
21 |
|
22 |
public function __construct() {
|
23 |
$this->gadwp = GADWP();
|
25 |
$profile = GADWP_Tools::get_selected_profile( $this->gadwp->config->options['ga_dash_profile_list'], $this->gadwp->config->options['ga_dash_tableid_jail'] );
|
26 |
|
27 |
$this->uaid = esc_html( $profile[2] );
|
28 |
+
}
|
29 |
+
|
30 |
+
protected function bulid_custom_dimensions() {
|
31 |
+
$custom_dimensions = array();
|
32 |
+
|
33 |
+
if ( $this->gadwp->config->options['ga_author_dimindex'] && ( is_single() || is_page() ) ) {
|
34 |
+
global $post;
|
35 |
+
$author_id = $post->post_author;
|
36 |
+
$author_name = get_the_author_meta( 'display_name', $author_id );
|
37 |
+
$index = (int) $this->gadwp->config->options['ga_author_dimindex'];
|
38 |
+
$custom_dimensions[$index] = esc_attr( $author_name );
|
39 |
+
}
|
40 |
+
|
41 |
+
if ( $this->gadwp->config->options['ga_pubyear_dimindex'] && is_single() ) {
|
42 |
+
global $post;
|
43 |
+
$date = get_the_date( 'Y', $post->ID );
|
44 |
+
$index = (int) $this->gadwp->config->options['ga_pubyear_dimindex'];
|
45 |
+
$custom_dimensions[$index] = (int) $date;
|
46 |
+
}
|
47 |
+
|
48 |
+
if ( $this->gadwp->config->options['ga_pubyearmonth_dimindex'] && is_single() ) {
|
49 |
+
global $post;
|
50 |
+
$date = get_the_date( 'Y-m', $post->ID );
|
51 |
+
$index = (int) $this->gadwp->config->options['ga_pubyearmonth_dimindex'];
|
52 |
+
$custom_dimensions[$index] = esc_attr( $date );
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( $this->gadwp->config->options['ga_category_dimindex'] && is_category() ) {
|
56 |
+
$fields = array();
|
57 |
+
$index = (int) $this->gadwp->config->options['ga_category_dimindex'];
|
58 |
+
$custom_dimensions[$index] = esc_attr( single_tag_title( '', false ) );
|
59 |
+
}
|
60 |
+
|
61 |
+
if ( $this->gadwp->config->options['ga_category_dimindex'] && is_single() ) {
|
62 |
+
global $post;
|
63 |
+
$categories = get_the_category( $post->ID );
|
64 |
+
foreach ( $categories as $category ) {
|
65 |
+
$index = (int) $this->gadwp->config->options['ga_category_dimindex'];
|
66 |
+
$custom_dimensions[$index] = esc_attr( $category->name );
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
if ( $this->gadwp->config->options['ga_tag_dimindex'] && is_single() ) {
|
72 |
+
global $post;
|
73 |
+
$fields = array();
|
74 |
+
$post_tags_list = '';
|
75 |
+
$post_tags_array = get_the_tags( $post->ID );
|
76 |
+
if ( $post_tags_array ) {
|
77 |
+
foreach ( $post_tags_array as $tag ) {
|
78 |
+
$post_tags_list .= $tag->name . ', ';
|
79 |
+
}
|
80 |
+
}
|
81 |
+
$post_tags_list = rtrim( $post_tags_list, ', ' );
|
82 |
+
if ( $post_tags_list ) {
|
83 |
+
$index = (int) $this->gadwp->config->options['ga_tag_dimindex'];
|
84 |
+
$custom_dimensions[$index] = esc_attr( $post_tags_list );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
if ( $this->gadwp->config->options['ga_user_dimindex'] ) {
|
89 |
+
$fields = array();
|
90 |
+
$index = (int) $this->gadwp->config->options['ga_user_dimindex'];
|
91 |
+
$custom_dimensions[$index] = is_user_logged_in() ? 'registered' : 'guest';
|
92 |
+
}
|
93 |
+
|
94 |
+
return $custom_dimensions;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
if ( ! class_exists( 'GADWP_Tracking_Analytics' ) ) {
|
100 |
+
|
101 |
+
class GADWP_Tracking_Analytics extends GADWP_Tracking_Analytics_Base {
|
102 |
+
|
103 |
+
private $commands;
|
104 |
+
|
105 |
+
public function __construct() {
|
106 |
+
parent::__construct();
|
107 |
|
108 |
$this->load_scripts();
|
109 |
|
116 |
} else {
|
117 |
add_action( 'wp_head', array( $this, 'output' ), 99 );
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
|
121 |
/**
|
148 |
* Styles & Scripts load
|
149 |
*/
|
150 |
private function load_scripts() {
|
151 |
+
if ( $this->gadwp->config->options['ga_event_tracking'] || $this->gadwp->config->options['ga_aff_tracking'] || $this->gadwp->config->options['ga_hash_tracking'] || $this->gadwp->config->options['ga_pagescrolldepth_tracking'] || $this->gadwp->config->options['ga_formsubmit_tracking'] ) {
|
152 |
|
153 |
$root_domain = GADWP_Tools::get_root_domain();
|
154 |
|
215 |
if ( 1 != $this->gadwp->config->options['ga_speed_samplerate'] ) {
|
216 |
$fieldsobject['siteSpeedSampleRate'] = (int) $this->gadwp->config->options['ga_speed_samplerate'];
|
217 |
}
|
218 |
+
if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
|
219 |
+
$fieldsobject['sampleRate'] = (int) $this->gadwp->config->options['ga_user_samplerate'];
|
220 |
+
}
|
221 |
if ( $this->gadwp->config->options['ga_crossdomain_tracking'] && '' != $this->gadwp->config->options['ga_crossdomain_list'] ) {
|
222 |
$fieldsobject['allowLinker'] = 'true';
|
223 |
}
|
261 |
$this->add( 'require', $fields );
|
262 |
}
|
263 |
|
264 |
+
$custom_dimensions = $this->bulid_custom_dimensions();
|
265 |
+
if ( ! empty( $custom_dimensions ) ) {
|
266 |
+
foreach ( $custom_dimensions as $index => $value ) {
|
267 |
+
$fields = array();
|
268 |
+
$fields['dimension'] = 'dimension' . $index;
|
269 |
+
$fields['value'] = $value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
$this->add( 'set', $fields );
|
271 |
}
|
272 |
}
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
if ( $this->gadwp->config->options['ga_dash_anonim'] ) {
|
275 |
$fields = array();
|
276 |
$fields['option'] = 'anonymizeIp';
|
344 |
|
345 |
GADWP_Tools::load_view( 'front/views/analytics-code.php', array( 'trackingcode' => $trackingcode ) );
|
346 |
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
if ( ! class_exists( 'GADWP_Tracking_Analytics_AMP' ) ) {
|
351 |
+
|
352 |
+
class GADWP_Tracking_Analytics_AMP extends GADWP_Tracking_Analytics_Base {
|
353 |
+
|
354 |
+
private $config;
|
355 |
+
|
356 |
+
public function __construct() {
|
357 |
+
parent::__construct();
|
358 |
+
|
359 |
+
add_filter( 'amp_post_template_data', array( $this, 'load_scripts' ) );
|
360 |
+
add_action( 'amp_post_template_footer', array( $this, 'output' ) );
|
361 |
+
}
|
362 |
|
363 |
/**
|
364 |
* Inserts the Analytics AMP script in the head section
|
365 |
*/
|
366 |
+
public function load_scripts( $data ) {
|
367 |
+
if ( ! isset( $data['amp_component_scripts'] ) ) {
|
368 |
+
$data['amp_component_scripts'] = array();
|
369 |
+
}
|
370 |
+
|
371 |
+
$data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
|
372 |
+
|
373 |
+
return $data;
|
374 |
+
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Retrieves the AMP config array
|
378 |
+
*/
|
379 |
+
public function get() {
|
380 |
+
return $this->config;
|
381 |
+
}
|
382 |
+
|
383 |
+
/**
|
384 |
+
* Stores the AMP config array
|
385 |
+
* @param array $config
|
386 |
+
*/
|
387 |
+
public function set( $config ) {
|
388 |
+
$this->config = $config;
|
389 |
+
}
|
390 |
+
|
391 |
+
private function build_json() {
|
392 |
+
$this->config = array();
|
393 |
+
|
394 |
+
// Set the Tracking ID
|
395 |
+
/* @formatter:off */
|
396 |
+
$this->config['vars'] = array(
|
397 |
+
'account' => $this->uaid,
|
398 |
+
'documentLocation' => '${canonicalUrl}',
|
399 |
+
);
|
400 |
+
/* @formatter:on */
|
401 |
+
|
402 |
+
// Set Custom Dimensions as extraUrlParams
|
403 |
+
$custom_dimensions = $this->bulid_custom_dimensions();
|
404 |
+
|
405 |
+
if ( ! empty( $custom_dimensions ) ) {
|
406 |
+
foreach ( $custom_dimensions as $index => $value ) {
|
407 |
+
$dimension = 'cd' . $index;
|
408 |
+
$this->config['extraUrlParams'][$dimension] = $value;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
|
412 |
+
// Set Triggers
|
413 |
+
/* @formatter:off */
|
414 |
+
$this->config['triggers']['gadwpTrackPageview'] = array(
|
415 |
+
'on' => 'visible',
|
416 |
+
'request' => 'pageview',
|
417 |
+
);
|
418 |
+
/* @formatter:on */
|
419 |
+
|
420 |
+
// Set Sampling Rate only if lower than 100%
|
421 |
+
if ( 100 != $this->gadwp->config->options['ga_user_samplerate'] ) {
|
422 |
+
/* @formatter:off */
|
423 |
+
$this->config['triggers']['gadwpTrackPageview']['sampleSpec'] = array(
|
424 |
+
'sampleOn' => '${clientId}',
|
425 |
+
'threshold' => (int) $this->gadwp->config->options['ga_user_samplerate'],
|
426 |
+
);
|
427 |
+
/* @formatter:on */
|
428 |
+
}
|
429 |
+
|
430 |
+
// Set Scroll events
|
431 |
+
if ( $this->gadwp->config->options['ga_pagescrolldepth_tracking'] ) {
|
432 |
+
/* @formatter:off */
|
433 |
+
$this->config['triggers']['gadwpScrollPings'] = array (
|
434 |
+
'on' => 'scroll',
|
435 |
+
'scrollSpec' => array(
|
436 |
+
'verticalBoundaries' => '[25, 50, 75, 100]',
|
437 |
+
),
|
438 |
+
'request' => 'event',
|
439 |
+
'vars' => array(
|
440 |
+
'eventCategory' => 'Scroll Depth',
|
441 |
+
'eventAction' => 'Percentage',
|
442 |
+
'eventLabel' => '${verticalScrollBoundary}%',
|
443 |
+
),
|
444 |
+
);
|
445 |
+
/* @formatter:on */
|
446 |
+
}
|
447 |
+
|
448 |
+
// Set downloads, outbound links, affiliate links, hashmarks, email, telephone events
|
449 |
+
if ( $this->gadwp->config->options['ga_event_tracking'] ) {
|
450 |
+
/* @formatter:off */
|
451 |
+
$this->config['triggers']['gadwpEventTracking'] = array (
|
452 |
+
'on' => 'click',
|
453 |
+
'selector' => 'a',
|
454 |
+
'request' => 'event',
|
455 |
+
'vars' => array(
|
456 |
+
'eventCategory' => '${gaCategory}',
|
457 |
+
'eventAction' => '${gaAction}',
|
458 |
+
'eventLabel' => '${gaLabel}',
|
459 |
+
),
|
460 |
+
);
|
461 |
+
/* @formatter:on */
|
462 |
+
}
|
463 |
+
// Set form submit event
|
464 |
+
if ( $this->gadwp->config->options['ga_formsubmit_tracking'] ) {
|
465 |
+
/* @formatter:off */
|
466 |
+
$this->config['triggers']['gadwpFormSubmit'] = array (
|
467 |
+
'on' => 'click',
|
468 |
+
'selector' => 'input[type="submit"]',
|
469 |
+
'request' => 'event',
|
470 |
+
'vars' => array(
|
471 |
+
'eventCategory' => '${gaCategory}',
|
472 |
+
'eventAction' => '${gaAction}',
|
473 |
+
'eventLabel' => '${gaLabel}',
|
474 |
+
),
|
475 |
+
);
|
476 |
+
/* @formatter:on */
|
477 |
+
}
|
478 |
+
|
479 |
+
do_action( 'gadwp_analytics_amp_config', $this );
|
480 |
}
|
481 |
|
482 |
/**
|
483 |
* Outputs the Google Analytics tracking code for AMP
|
484 |
*/
|
485 |
+
public function output() {
|
486 |
+
$this->build_json();
|
487 |
+
|
488 |
+
if ( version_compare( phpversion(), '5.4.0', '<' ) ) {
|
489 |
+
$json = json_encode( $this->config );
|
490 |
+
} else {
|
491 |
+
$json = json_encode( $this->config, JSON_PRETTY_PRINT );
|
492 |
+
}
|
493 |
+
|
494 |
+
$json = str_replace( array( '"[', ']"' ), array( '[', ']' ), $json ); //make verticalBoundaries a JavaScript array
|
495 |
+
|
496 |
+
$data = array( 'json' => $json );
|
497 |
+
|
498 |
+
GADWP_Tools::load_view( 'front/views/analytics-amp-code.php', $data );
|
499 |
}
|
500 |
}
|
501 |
}
|
front/tracking-tagmanager.php
CHANGED
@@ -31,7 +31,7 @@ if ( ! class_exists( 'GADWP_Tracking_TagManager' ) ) {
|
|
31 |
}
|
32 |
|
33 |
if ( $this->gadwp->config->options['amp_tracking_tagmanager'] && $this->gadwp->config->options['amp_containerid'] ) {
|
34 |
-
|
35 |
add_action( 'amp_post_template_footer', array( $this, 'amp_output' ) );
|
36 |
}
|
37 |
}
|
@@ -153,8 +153,14 @@ if ( ! class_exists( 'GADWP_Tracking_TagManager' ) ) {
|
|
153 |
/**
|
154 |
* Inserts the Analytics AMP script in the head section
|
155 |
*/
|
156 |
-
public function amp_add_analytics_script() {
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
/**
|
31 |
}
|
32 |
|
33 |
if ( $this->gadwp->config->options['amp_tracking_tagmanager'] && $this->gadwp->config->options['amp_containerid'] ) {
|
34 |
+
add_filter( 'amp_post_template_data', array( $this, 'amp_add_analytics_script' ) );
|
35 |
add_action( 'amp_post_template_footer', array( $this, 'amp_output' ) );
|
36 |
}
|
37 |
}
|
153 |
/**
|
154 |
* Inserts the Analytics AMP script in the head section
|
155 |
*/
|
156 |
+
public function amp_add_analytics_script( $data ) {
|
157 |
+
if ( ! isset( $data['amp_component_scripts'] ) ) {
|
158 |
+
$data['amp_component_scripts'] = array();
|
159 |
+
}
|
160 |
+
|
161 |
+
$data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
|
162 |
+
|
163 |
+
return $data;
|
164 |
}
|
165 |
|
166 |
/**
|
front/tracking.php
CHANGED
@@ -19,7 +19,7 @@ if ( ! class_exists( 'GADWP_Tracking' ) ) {
|
|
19 |
|
20 |
public $analytics;
|
21 |
|
22 |
-
public $
|
23 |
|
24 |
public $tagmanager;
|
25 |
|
@@ -29,6 +29,10 @@ if ( ! class_exists( 'GADWP_Tracking' ) ) {
|
|
29 |
$this->init();
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
32 |
public function init() {
|
33 |
// excluded roles
|
34 |
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_track_exclude'], true ) || ( $this->gadwp->config->options['ga_dash_excludesa'] && current_user_can( 'manage_network' ) ) ) {
|
@@ -40,6 +44,11 @@ if ( ! class_exists( 'GADWP_Tracking' ) ) {
|
|
40 |
// Analytics
|
41 |
require_once 'tracking-analytics.php';
|
42 |
$this->analytics = new GADWP_Tracking_Analytics();
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
if ( 'tagmanager' == $this->gadwp->config->options['ga_dash_tracking_type'] && $this->gadwp->config->options['web_containerid'] ) {
|
19 |
|
20 |
public $analytics;
|
21 |
|
22 |
+
public $analytics_amp;
|
23 |
|
24 |
public $tagmanager;
|
25 |
|
29 |
$this->init();
|
30 |
}
|
31 |
|
32 |
+
public function tracking_code() { // Removed since 5.0
|
33 |
+
GADWP_Tools::doing_it_wrong( __METHOD__, __( "This method is deprecated, read the documentation!", 'google-analytics-dashboard-for-wp' ), '5.0' );
|
34 |
+
}
|
35 |
+
|
36 |
public function init() {
|
37 |
// excluded roles
|
38 |
if ( GADWP_Tools::check_roles( $this->gadwp->config->options['ga_track_exclude'], true ) || ( $this->gadwp->config->options['ga_dash_excludesa'] && current_user_can( 'manage_network' ) ) ) {
|
44 |
// Analytics
|
45 |
require_once 'tracking-analytics.php';
|
46 |
$this->analytics = new GADWP_Tracking_Analytics();
|
47 |
+
|
48 |
+
if ( $this->gadwp->config->options['amp_tracking_analytics'] ) {
|
49 |
+
$this->analytics_amp = new GADWP_Tracking_Analytics_AMP();
|
50 |
+
}
|
51 |
+
|
52 |
}
|
53 |
|
54 |
if ( 'tagmanager' == $this->gadwp->config->options['ga_dash_tracking_type'] && $this->gadwp->config->options['web_containerid'] ) {
|
front/views/analytics-amp-code.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Alin Marcu
|
4 |
+
* Copyright 2017 Alin Marcu
|
5 |
+
* Author URI: https://deconf.com
|
6 |
+
* License: GPLv2 or later
|
7 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<amp-analytics type="googleanalytics" id="gadwp-googleanalytics">
|
11 |
+
<script type="application/json">
|
12 |
+
<?php echo $data['json']; ?>
|
13 |
+
</script>
|
14 |
+
</amp-analytics>
|
front/views/analytics-code.php
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Universal Analytics - https://deconf.com/google-analytics-dashboard-wordpress/ -->
|
3 |
<script>
|
4 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Alin Marcu
|
4 |
+
* Copyright 2017 Alin Marcu
|
5 |
+
* Author URI: https://deconf.com
|
6 |
+
* License: GPLv2 or later
|
7 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
?>
|
10 |
<!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Universal Analytics - https://deconf.com/google-analytics-dashboard-wordpress/ -->
|
11 |
<script>
|
12 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
front/views/optimize-code.php
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<style>
|
2 |
.async-hide {
|
3 |
opacity: 0 !important
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Alin Marcu
|
4 |
+
* Copyright 2017 Alin Marcu
|
5 |
+
* Author URI: https://deconf.com
|
6 |
+
* License: GPLv2 or later
|
7 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
?>
|
10 |
<style>
|
11 |
.async-hide {
|
12 |
opacity: 0 !important
|
front/views/tagmanager-code.php
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Tag Manager - https://deconf.com/google-analytics-dashboard-wordpress/ -->
|
3 |
<script>
|
4 |
window.dataLayer = window.dataLayer || [];
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Alin Marcu
|
4 |
+
* Copyright 2017 Alin Marcu
|
5 |
+
* Author URI: https://deconf.com
|
6 |
+
* License: GPLv2 or later
|
7 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
*/
|
9 |
+
?>
|
10 |
<!-- BEGIN GADWP v<?php echo GADWP_CURRENT_VERSION; ?> Tag Manager - https://deconf.com/google-analytics-dashboard-wordpress/ -->
|
11 |
<script>
|
12 |
window.dataLayer = window.dataLayer || [];
|
gadwp.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://deconf.com
|
5 |
* Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
|
6 |
* Author: Alin Marcu
|
7 |
-
* Version: 5.
|
8 |
* Author URI: https://deconf.com
|
9 |
* Text Domain: google-analytics-dashboard-for-wp
|
10 |
* Domain Path: /languages
|
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) )
|
|
16 |
|
17 |
// Plugin Version
|
18 |
if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
|
19 |
-
define( 'GADWP_CURRENT_VERSION', '5.
|
20 |
}
|
21 |
|
22 |
if ( ! class_exists( 'GADWP_Manager' ) ) {
|
4 |
* Plugin URI: https://deconf.com
|
5 |
* Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
|
6 |
* Author: Alin Marcu
|
7 |
+
* Version: 5.1
|
8 |
* Author URI: https://deconf.com
|
9 |
* Text Domain: google-analytics-dashboard-for-wp
|
10 |
* Domain Path: /languages
|
16 |
|
17 |
// Plugin Version
|
18 |
if ( ! defined( 'GADWP_CURRENT_VERSION' ) ) {
|
19 |
+
define( 'GADWP_CURRENT_VERSION', '5.1' );
|
20 |
}
|
21 |
|
22 |
if ( ! class_exists( 'GADWP_Manager' ) ) {
|
install/install.php
CHANGED
@@ -42,6 +42,7 @@ class GADWP_Install {
|
|
42 |
$options['ga_dash_frontend_stats'] = 0;
|
43 |
$options['ga_dash_network'] = 0;
|
44 |
$options['ga_speed_samplerate'] = 1;
|
|
|
45 |
$options['ga_event_bouncerate'] = 0;
|
46 |
$options['ga_crossdomain_tracking'] = 0;
|
47 |
$options['ga_crossdomain_list'] = '';
|
@@ -151,6 +152,8 @@ class GADWP_Install {
|
|
151 |
$options['ga_dash_excludesa'] = 0;
|
152 |
$options['ga_pagescrolldepth_tracking'] = 0;
|
153 |
$options['tm_pagescrolldepth_tracking'] = 0;
|
|
|
|
|
154 |
|
155 |
delete_option( 'ga_dash_clientid' );
|
156 |
delete_option( 'ga_dash_clientsecret' );
|
42 |
$options['ga_dash_frontend_stats'] = 0;
|
43 |
$options['ga_dash_network'] = 0;
|
44 |
$options['ga_speed_samplerate'] = 1;
|
45 |
+
$options['ga_user_samplerate'] = 100;
|
46 |
$options['ga_event_bouncerate'] = 0;
|
47 |
$options['ga_crossdomain_tracking'] = 0;
|
48 |
$options['ga_crossdomain_list'] = '';
|
152 |
$options['ga_dash_excludesa'] = 0;
|
153 |
$options['ga_pagescrolldepth_tracking'] = 0;
|
154 |
$options['tm_pagescrolldepth_tracking'] = 0;
|
155 |
+
$options['ga_speed_samplerate'] = 1;
|
156 |
+
$options['ga_user_samplerate'] = 100;
|
157 |
|
158 |
delete_option( 'ga_dash_clientid' );
|
159 |
delete_option( 'ga_dash_clientsecret' );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://deconf.com/donate/
|
|
4 |
Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -45,6 +45,7 @@ Installs the latest Google Analytics tracking code and allows full code customiz
|
|
45 |
- Enhanced link attribution
|
46 |
- Remarketing, demographics and interests tracking
|
47 |
- Page Speed sampling rate control
|
|
|
48 |
- Cross domain tracking
|
49 |
- Exclude user roles from tracking
|
50 |
- Accelerated Mobile Pages (AMP) support for Google Analytics
|
@@ -79,7 +80,25 @@ As an alternative to Google Analytics tracking code, you can use Google Tag Mana
|
|
79 |
- Data Layer variables: authors, publication year, publication month, categories, tags, user type
|
80 |
- Additional Data Layer variables for page scrolling depth
|
81 |
- Exclude user roles from tracking
|
82 |
-
- Accelerated Mobile Pages (AMP) support for Google Tag Manager
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
= Google Analytics Dashboard for WP on Multisite =
|
85 |
|
@@ -151,6 +170,24 @@ This is a major update, please read the [release notes](https://deconf.com/googl
|
|
151 |
|
152 |
== Changelog ==
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
= 5.0.1 =
|
155 |
* Enhancements:
|
156 |
* use site_url() to find the main domain name
|
4 |
Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 5.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
45 |
- Enhanced link attribution
|
46 |
- Remarketing, demographics and interests tracking
|
47 |
- Page Speed sampling rate control
|
48 |
+
- User sampling rate control
|
49 |
- Cross domain tracking
|
50 |
- Exclude user roles from tracking
|
51 |
- Accelerated Mobile Pages (AMP) support for Google Analytics
|
80 |
- Data Layer variables: authors, publication year, publication month, categories, tags, user type
|
81 |
- Additional Data Layer variables for page scrolling depth
|
82 |
- Exclude user roles from tracking
|
83 |
+
- Accelerated Mobile Pages (AMP) support for Google Tag Manager
|
84 |
+
|
85 |
+
= Accelerated Mobile Pages (AMP) features =
|
86 |
+
|
87 |
+
Out-of-the box features for AMP:
|
88 |
+
|
89 |
+
- Google Tag Manager basic tracking
|
90 |
+
- Google Analytics basic tracking
|
91 |
+
- Automatically removes <em>amp/</em> from Google Analytics tracking page URL
|
92 |
+
- Scrolling depth tracking
|
93 |
+
- Custom dimensions tracking
|
94 |
+
- User sampling rate control
|
95 |
+
|
96 |
+
Events tracking for AMP using annotated HTML elements (data-vars-ga-* attributes):
|
97 |
+
|
98 |
+
- form submit tracking
|
99 |
+
- file downloads tracking
|
100 |
+
- affiliate links tracking
|
101 |
+
- hashmarks, outbound links, telephones and e-mails tracking
|
102 |
|
103 |
= Google Analytics Dashboard for WP on Multisite =
|
104 |
|
170 |
|
171 |
== Changelog ==
|
172 |
|
173 |
+
= 5.1 =
|
174 |
+
* Bug Fixes:
|
175 |
+
* if tracking is disabled it keeps it that way while upgrading from versions lower than 5.0
|
176 |
+
* fixes the undeclared variable gadwpSubmitObject error on submitted forms
|
177 |
+
* added deprecation warning for tracking_code method
|
178 |
+
* fix network admin menu capabilities, props by [Maxime Culea](https://github.com/MaximeCulea)
|
179 |
+
* Enhancements:
|
180 |
+
* switch to a customized version of GAPI to avoid conflicts with other plugins
|
181 |
+
* automatically remove <em>amp/</em> from Google Analytics tracking page URL
|
182 |
+
* events tracking is now using <em>data-vars-ga-*</em> attributes instead of <em>data-ga-*</em>
|
183 |
+
* increase default report expiration cookie from 7 days to 365 days
|
184 |
+
* New Features:
|
185 |
+
* sampleRate support for web analytics and AMP
|
186 |
+
* custom dimensions tracking support for AMP
|
187 |
+
* scrolling depth tracking support for AMP
|
188 |
+
* form submit tracking support for AMP
|
189 |
+
* downloads, affiliate links, hashmarks, outbound links, telephones, e-mails tracking support for AMP
|
190 |
+
|
191 |
= 5.0.1 =
|
192 |
* Enhancements:
|
193 |
* use site_url() to find the main domain name
|
tools/gapi.php
CHANGED
@@ -32,9 +32,9 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
32 |
public function __construct() {
|
33 |
$this->gadwp = GADWP();
|
34 |
|
35 |
-
include_once ( GADWP_DIR . 'tools/src/
|
36 |
-
$config = new
|
37 |
-
$config->setCacheClass( '
|
38 |
if ( function_exists( 'curl_version' ) ) {
|
39 |
$curlversion = curl_version();
|
40 |
$curl_options = array();
|
@@ -43,10 +43,10 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
43 |
}
|
44 |
$curl_options = apply_filters( 'gadwp_curl_options', $curl_options );
|
45 |
if ( ! empty( $curl_options ) ) {
|
46 |
-
$config->setClassConfig( '
|
47 |
}
|
48 |
}
|
49 |
-
$this->client = new
|
50 |
$this->client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly', 'https://www.googleapis.com/auth/analytics.edit' ) );
|
51 |
$this->client->setAccessType( 'offline' );
|
52 |
$this->client->setApplicationName( 'Google Analytics Dashboard' );
|
@@ -61,16 +61,16 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
61 |
$this->client->setClientId( $this->access[0] );
|
62 |
$this->client->setClientSecret( $this->access[1] );
|
63 |
}
|
64 |
-
$this->service = new
|
65 |
if ( $this->gadwp->config->options['ga_dash_token'] ) {
|
66 |
$token = $this->gadwp->config->options['ga_dash_token'];
|
67 |
if ( $token ) {
|
68 |
try {
|
69 |
$this->client->setAccessToken( $token );
|
70 |
$gadwp->config->options['ga_dash_token'] = $this->client->getAccessToken();
|
71 |
-
} catch (
|
72 |
GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
|
73 |
-
} catch (
|
74 |
GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
75 |
GADWP_Tools::set_cache( 'ga_dash_gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
76 |
$this->reset_token();
|
@@ -148,36 +148,8 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
148 |
* Generates and retrieves the Access Code
|
149 |
*/
|
150 |
public function token_request() {
|
151 |
-
$authUrl = $this->client->createAuthUrl();
|
152 |
-
|
153 |
-
<form name="input" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" method="post">
|
154 |
-
<table class="gadwp-settings-options">
|
155 |
-
<tr>
|
156 |
-
<td colspan="2" class="gadwp-settings-info">
|
157 |
-
<?php echo __( "Use this link to get your access code:", 'google-analytics-dashboard-for-wp' ) . ' <a href="' . $authUrl . '" id="gapi-access-code" target="_blank">' . __ ( "Get Access Code", 'google-analytics-dashboard-for-wp' ) . '</a>.'; ?>
|
158 |
-
</td>
|
159 |
-
</tr>
|
160 |
-
<tr>
|
161 |
-
<td class="gadwp-settings-title">
|
162 |
-
<label for="ga_dash_code" title="<?php _e("Use the red link to get your access code!",'google-analytics-dashboard-for-wp')?>"><?php echo _e( "Access Code:", 'google-analytics-dashboard-for-wp' ); ?></label>
|
163 |
-
</td>
|
164 |
-
<td>
|
165 |
-
<input type="text" id="ga_dash_code" name="ga_dash_code" value="" size="61" required="required" title="<?php _e("Use the red link to get your access code!",'google-analytics-dashboard-for-wp')?>">
|
166 |
-
</td>
|
167 |
-
</tr>
|
168 |
-
<tr>
|
169 |
-
<td colspan="2">
|
170 |
-
<hr>
|
171 |
-
</td>
|
172 |
-
</tr>
|
173 |
-
<tr>
|
174 |
-
<td colspan="2">
|
175 |
-
<input type="submit" class="button button-secondary" name="ga_dash_authorize" value="<?php _e( "Save Access Code", 'google-analytics-dashboard-for-wp' ); ?>" />
|
176 |
-
</td>
|
177 |
-
</tr>
|
178 |
-
</table>
|
179 |
-
</form>
|
180 |
-
<?php
|
181 |
}
|
182 |
|
183 |
/**
|
@@ -218,10 +190,10 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
218 |
GADWP_Tools::delete_cache( 'last_error' );
|
219 |
}
|
220 |
return $ga_dash_profile_list;
|
221 |
-
} catch (
|
222 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
|
223 |
return $ga_dash_profile_list;
|
224 |
-
} catch (
|
225 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
226 |
GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
227 |
} catch ( Exception $e ) {
|
@@ -273,7 +245,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
273 |
* $options
|
274 |
* @param
|
275 |
* $serial
|
276 |
-
* @return int|
|
277 |
*/
|
278 |
private function handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ) {
|
279 |
try {
|
@@ -303,7 +275,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
303 |
} else {
|
304 |
$data = $transient;
|
305 |
}
|
306 |
-
} catch (
|
307 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
308 |
GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
309 |
return $e->getCode();
|
@@ -314,7 +286,9 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
314 |
if ( $data->getRows() > 0 ) {
|
315 |
return $data;
|
316 |
} else {
|
317 |
-
|
|
|
|
|
318 |
}
|
319 |
}
|
320 |
|
@@ -384,6 +358,9 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
384 |
if ( is_numeric( $data ) ) {
|
385 |
return $data;
|
386 |
}
|
|
|
|
|
|
|
387 |
$gadwp_data = array( array( $dayorhour, $title ) );
|
388 |
if ( 'today' == $from || 'yesterday' == $from ) {
|
389 |
foreach ( $data->getRows() as $row ) {
|
@@ -436,7 +413,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
436 |
$serial = 'qr3_' . $this->get_serial( $projectId . $from . $filter );
|
437 |
$data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
|
438 |
if ( is_numeric( $data ) ) {
|
439 |
-
if ( - 21 == $data ) {
|
440 |
return array_fill( 0, 9, 0 );
|
441 |
} else {
|
442 |
return $data;
|
@@ -680,6 +657,9 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
680 |
if ( is_numeric( $data ) ) {
|
681 |
return $data;
|
682 |
}
|
|
|
|
|
|
|
683 |
$block = ( 'channelGrouping' == $query ) ? __( "Channels", 'google-analytics-dashboard-for-wp' ) : __( "Devices", 'google-analytics-dashboard-for-wp' );
|
684 |
$gadwp_data = array( array( '<div style="color:black; font-size:1.1em">' . $block . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $data['totalsForAllResults'][$metrics] . '</div>', "" ) );
|
685 |
foreach ( $data->getRows() as $row ) {
|
@@ -810,7 +790,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
810 |
} else {
|
811 |
$data = $transient;
|
812 |
}
|
813 |
-
} catch (
|
814 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
815 |
GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
816 |
return $e->getCode();
|
@@ -852,7 +832,7 @@ if ( ! class_exists( 'GADWP_GAPI_Controller' ) ) {
|
|
852 |
* $to
|
853 |
* @param
|
854 |
* $filter
|
855 |
-
* @return number|
|
856 |
*/
|
857 |
public function get( $projectId, $query, $from = false, $to = false, $filter = '', $metric = 'sessions' ) {
|
858 |
if ( empty( $projectId ) || ! is_numeric( $projectId ) ) {
|
32 |
public function __construct() {
|
33 |
$this->gadwp = GADWP();
|
34 |
|
35 |
+
include_once ( GADWP_DIR . 'tools/src/Deconf/autoload.php' );
|
36 |
+
$config = new Deconf_Config();
|
37 |
+
$config->setCacheClass( 'Deconf_Cache_Null' );
|
38 |
if ( function_exists( 'curl_version' ) ) {
|
39 |
$curlversion = curl_version();
|
40 |
$curl_options = array();
|
43 |
}
|
44 |
$curl_options = apply_filters( 'gadwp_curl_options', $curl_options );
|
45 |
if ( ! empty( $curl_options ) ) {
|
46 |
+
$config->setClassConfig( 'Deconf_IO_Curl', array( 'options' => $curl_options ) );
|
47 |
}
|
48 |
}
|
49 |
+
$this->client = new Deconf_Client( $config );
|
50 |
$this->client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly', 'https://www.googleapis.com/auth/analytics.edit' ) );
|
51 |
$this->client->setAccessType( 'offline' );
|
52 |
$this->client->setApplicationName( 'Google Analytics Dashboard' );
|
61 |
$this->client->setClientId( $this->access[0] );
|
62 |
$this->client->setClientSecret( $this->access[1] );
|
63 |
}
|
64 |
+
$this->service = new Deconf_Service_Analytics( $this->client );
|
65 |
if ( $this->gadwp->config->options['ga_dash_token'] ) {
|
66 |
$token = $this->gadwp->config->options['ga_dash_token'];
|
67 |
if ( $token ) {
|
68 |
try {
|
69 |
$this->client->setAccessToken( $token );
|
70 |
$gadwp->config->options['ga_dash_token'] = $this->client->getAccessToken();
|
71 |
+
} catch ( Deconf_IO_Exception $e ) {
|
72 |
GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
|
73 |
+
} catch ( Deconf_Service_Exception $e ) {
|
74 |
GADWP_Tools::set_cache( 'ga_dash_lasterror', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
75 |
GADWP_Tools::set_cache( 'ga_dash_gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
76 |
$this->reset_token();
|
148 |
* Generates and retrieves the Access Code
|
149 |
*/
|
150 |
public function token_request() {
|
151 |
+
$data['authUrl'] = $this->client->createAuthUrl();
|
152 |
+
GADWP_Tools::load_view( 'admin/views/access-code.php', $data );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
|
155 |
/**
|
190 |
GADWP_Tools::delete_cache( 'last_error' );
|
191 |
}
|
192 |
return $ga_dash_profile_list;
|
193 |
+
} catch ( Deconf_IO_Exception $e ) {
|
194 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout );
|
195 |
return $ga_dash_profile_list;
|
196 |
+
} catch ( Deconf_Service_Exception $e ) {
|
197 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
198 |
GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
199 |
} catch ( Exception $e ) {
|
245 |
* $options
|
246 |
* @param
|
247 |
* $serial
|
248 |
+
* @return int|Deconf_Service_Analytics_GaData
|
249 |
*/
|
250 |
private function handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ) {
|
251 |
try {
|
275 |
} else {
|
276 |
$data = $transient;
|
277 |
}
|
278 |
+
} catch ( Deconf_Service_Exception $e ) {
|
279 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
280 |
GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
281 |
return $e->getCode();
|
286 |
if ( $data->getRows() > 0 ) {
|
287 |
return $data;
|
288 |
} else {
|
289 |
+
$data->rows = array();
|
290 |
+
return $data;
|
291 |
+
// return - 21;
|
292 |
}
|
293 |
}
|
294 |
|
358 |
if ( is_numeric( $data ) ) {
|
359 |
return $data;
|
360 |
}
|
361 |
+
if ( empty( $data->rows ) ) {
|
362 |
+
return - 21;
|
363 |
+
}
|
364 |
$gadwp_data = array( array( $dayorhour, $title ) );
|
365 |
if ( 'today' == $from || 'yesterday' == $from ) {
|
366 |
foreach ( $data->getRows() as $row ) {
|
413 |
$serial = 'qr3_' . $this->get_serial( $projectId . $from . $filter );
|
414 |
$data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial );
|
415 |
if ( is_numeric( $data ) ) {
|
416 |
+
if ( - 21 == $data or empty( $data->rows ) ) {
|
417 |
return array_fill( 0, 9, 0 );
|
418 |
} else {
|
419 |
return $data;
|
657 |
if ( is_numeric( $data ) ) {
|
658 |
return $data;
|
659 |
}
|
660 |
+
if ( empty( $data->rows ) ) {
|
661 |
+
return - 21;
|
662 |
+
}
|
663 |
$block = ( 'channelGrouping' == $query ) ? __( "Channels", 'google-analytics-dashboard-for-wp' ) : __( "Devices", 'google-analytics-dashboard-for-wp' );
|
664 |
$gadwp_data = array( array( '<div style="color:black; font-size:1.1em">' . $block . '</div><div style="color:darkblue; font-size:1.2em">' . (int) $data['totalsForAllResults'][$metrics] . '</div>', "" ) );
|
665 |
foreach ( $data->getRows() as $row ) {
|
790 |
} else {
|
791 |
$data = $transient;
|
792 |
}
|
793 |
+
} catch ( Deconf_Service_Exception $e ) {
|
794 |
GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout );
|
795 |
GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout );
|
796 |
return $e->getCode();
|
832 |
* $to
|
833 |
* @param
|
834 |
* $filter
|
835 |
+
* @return number|Deconf_Service_Analytics_GaData
|
836 |
*/
|
837 |
public function get( $projectId, $query, $from = false, $to = false, $filter = '', $metric = 'sessions' ) {
|
838 |
if ( empty( $projectId ) || ! is_numeric( $projectId ) ) {
|
tools/src/{Google → Deconf}/Auth/Abstract.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,15 +24,15 @@ if (!class_exists('Google_Client')) {
|
|
24 |
* @author Chris Chabot <chabotc@google.com>
|
25 |
*
|
26 |
*/
|
27 |
-
abstract class
|
28 |
{
|
29 |
/**
|
30 |
* An utility function that first calls $this->auth->sign($request) and then
|
31 |
* executes makeRequest() on that signed request. Used for when a request
|
32 |
* should be authenticated
|
33 |
-
* @param
|
34 |
-
* @return
|
35 |
*/
|
36 |
-
abstract public function authenticatedRequest(
|
37 |
-
abstract public function sign(
|
38 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
* @author Chris Chabot <chabotc@google.com>
|
25 |
*
|
26 |
*/
|
27 |
+
abstract class Deconf_Auth_Abstract
|
28 |
{
|
29 |
/**
|
30 |
* An utility function that first calls $this->auth->sign($request) and then
|
31 |
* executes makeRequest() on that signed request. Used for when a request
|
32 |
* should be authenticated
|
33 |
+
* @param Deconf_Http_Request $request
|
34 |
+
* @return Deconf_Http_Request $request
|
35 |
*/
|
36 |
+
abstract public function authenticatedRequest(Deconf_Http_Request $request);
|
37 |
+
abstract public function sign(Deconf_Http_Request $request);
|
38 |
}
|
tools/src/{Google → Deconf}/Auth/AppIdentity.php
RENAMED
@@ -22,21 +22,21 @@
|
|
22 |
*/
|
23 |
use google\appengine\api\app_identity\AppIdentityService;
|
24 |
|
25 |
-
if (!class_exists('
|
26 |
require_once dirname(__FILE__) . '/../autoload.php';
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
* Authentication via the Google App Engine App Identity service.
|
31 |
*/
|
32 |
-
class
|
33 |
{
|
34 |
-
const CACHE_PREFIX = "
|
35 |
private $client;
|
36 |
private $token = false;
|
37 |
private $tokenScopes = false;
|
38 |
|
39 |
-
public function __construct(
|
40 |
{
|
41 |
$this->client = $client;
|
42 |
}
|
@@ -91,17 +91,17 @@ class Google_Auth_AppIdentity extends Google_Auth_Abstract
|
|
91 |
* (which can modify the request in what ever way fits the auth mechanism)
|
92 |
* and then calls apiCurlIO::makeRequest on the signed request
|
93 |
*
|
94 |
-
* @param
|
95 |
-
* @return
|
96 |
* responseHttpCode, responseHeaders and responseBody.
|
97 |
*/
|
98 |
-
public function authenticatedRequest(
|
99 |
{
|
100 |
$request = $this->sign($request);
|
101 |
return $this->client->getIo()->makeRequest($request);
|
102 |
}
|
103 |
|
104 |
-
public function sign(
|
105 |
{
|
106 |
if (!$this->token) {
|
107 |
// No token, so nothing to do.
|
22 |
*/
|
23 |
use google\appengine\api\app_identity\AppIdentityService;
|
24 |
|
25 |
+
if (!class_exists('Deconf_Client')) {
|
26 |
require_once dirname(__FILE__) . '/../autoload.php';
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
* Authentication via the Google App Engine App Identity service.
|
31 |
*/
|
32 |
+
class Deconf_Auth_AppIdentity extends Deconf_Auth_Abstract
|
33 |
{
|
34 |
+
const CACHE_PREFIX = "Deconf_Auth_AppIdentity::";
|
35 |
private $client;
|
36 |
private $token = false;
|
37 |
private $tokenScopes = false;
|
38 |
|
39 |
+
public function __construct(Deconf_Client $client, $config = null)
|
40 |
{
|
41 |
$this->client = $client;
|
42 |
}
|
91 |
* (which can modify the request in what ever way fits the auth mechanism)
|
92 |
* and then calls apiCurlIO::makeRequest on the signed request
|
93 |
*
|
94 |
+
* @param Deconf_Http_Request $request
|
95 |
+
* @return Deconf_Http_Request The resulting HTTP response including the
|
96 |
* responseHttpCode, responseHeaders and responseBody.
|
97 |
*/
|
98 |
+
public function authenticatedRequest(Deconf_Http_Request $request)
|
99 |
{
|
100 |
$request = $this->sign($request);
|
101 |
return $this->client->getIo()->makeRequest($request);
|
102 |
}
|
103 |
|
104 |
+
public function sign(Deconf_Http_Request $request)
|
105 |
{
|
106 |
if (!$this->token) {
|
107 |
// No token, so nothing to do.
|
tools/src/{Google → Deconf}/Auth/AssertionCredentials.php
RENAMED
@@ -15,14 +15,14 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* Credentials object used for OAuth 2.0 Signed JWT assertion grants.
|
24 |
*/
|
25 |
-
class
|
26 |
{
|
27 |
const MAX_TOKEN_LIFETIME_SECS = 3600;
|
28 |
|
@@ -91,7 +91,7 @@ class Google_Auth_AssertionCredentials
|
|
91 |
$now = time();
|
92 |
|
93 |
$jwtParams = array(
|
94 |
-
'aud' =>
|
95 |
'scope' => $this->scopes,
|
96 |
'iat' => $now,
|
97 |
'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS,
|
@@ -122,14 +122,14 @@ class Google_Auth_AssertionCredentials
|
|
122 |
$payload = str_replace('\/', '/', $payload);
|
123 |
|
124 |
$segments = array(
|
125 |
-
|
126 |
-
|
127 |
);
|
128 |
|
129 |
$signingInput = implode('.', $segments);
|
130 |
-
$signer = new
|
131 |
$signature = $signer->sign($signingInput);
|
132 |
-
$segments[] =
|
133 |
|
134 |
return implode(".", $segments);
|
135 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* Credentials object used for OAuth 2.0 Signed JWT assertion grants.
|
24 |
*/
|
25 |
+
class Deconf_Auth_AssertionCredentials
|
26 |
{
|
27 |
const MAX_TOKEN_LIFETIME_SECS = 3600;
|
28 |
|
91 |
$now = time();
|
92 |
|
93 |
$jwtParams = array(
|
94 |
+
'aud' => Deconf_Auth_OAuth2::OAUTH2_TOKEN_URI,
|
95 |
'scope' => $this->scopes,
|
96 |
'iat' => $now,
|
97 |
'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS,
|
122 |
$payload = str_replace('\/', '/', $payload);
|
123 |
|
124 |
$segments = array(
|
125 |
+
Deconf_Utils::urlSafeB64Encode(json_encode($header)),
|
126 |
+
Deconf_Utils::urlSafeB64Encode($payload)
|
127 |
);
|
128 |
|
129 |
$signingInput = implode('.', $segments);
|
130 |
+
$signer = new Deconf_Signer_P12($this->privateKey, $this->privateKeyPassword);
|
131 |
$signature = $signer->sign($signingInput);
|
132 |
+
$segments[] = Deconf_Utils::urlSafeB64Encode($signature);
|
133 |
|
134 |
return implode(".", $segments);
|
135 |
}
|
tools/src/{Google → Deconf}/Auth/ComputeEngine.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -25,14 +25,14 @@ if (!class_exists('Google_Client')) {
|
|
25 |
* and the appropriate scopes.
|
26 |
* @author Jonathan Parrott <jon.wayne.parrott@gmail.com>
|
27 |
*/
|
28 |
-
class
|
29 |
{
|
30 |
const METADATA_AUTH_URL =
|
31 |
'http://metadata/computeMetadata/v1/instance/service-accounts/default/token';
|
32 |
private $client;
|
33 |
private $token;
|
34 |
|
35 |
-
public function __construct(
|
36 |
{
|
37 |
$this->client = $client;
|
38 |
}
|
@@ -43,11 +43,11 @@ class Google_Auth_ComputeEngine extends Google_Auth_Abstract
|
|
43 |
* (which can modify the request in what ever way fits the auth mechanism)
|
44 |
* and then calls apiCurlIO::makeRequest on the signed request
|
45 |
*
|
46 |
-
* @param
|
47 |
-
* @return
|
48 |
* responseHttpCode, responseHeaders and responseBody.
|
49 |
*/
|
50 |
-
public function authenticatedRequest(
|
51 |
{
|
52 |
$request = $this->sign($request);
|
53 |
return $this->client->getIo()->makeRequest($request);
|
@@ -55,16 +55,16 @@ class Google_Auth_ComputeEngine extends Google_Auth_Abstract
|
|
55 |
|
56 |
/**
|
57 |
* @param string $token
|
58 |
-
* @throws
|
59 |
*/
|
60 |
public function setAccessToken($token)
|
61 |
{
|
62 |
$token = json_decode($token, true);
|
63 |
if ($token == null) {
|
64 |
-
throw new
|
65 |
}
|
66 |
if (! isset($token['access_token'])) {
|
67 |
-
throw new
|
68 |
}
|
69 |
$token['created'] = time();
|
70 |
$this->token = $token;
|
@@ -77,15 +77,15 @@ class Google_Auth_ComputeEngine extends Google_Auth_Abstract
|
|
77 |
|
78 |
/**
|
79 |
* Acquires a new access token from the compute engine metadata server.
|
80 |
-
* @throws
|
81 |
*/
|
82 |
public function acquireAccessToken()
|
83 |
{
|
84 |
-
$request = new
|
85 |
self::METADATA_AUTH_URL,
|
86 |
'GET',
|
87 |
array(
|
88 |
-
'Metadata-Flavor' => '
|
89 |
)
|
90 |
);
|
91 |
$request->disableGzip();
|
@@ -96,7 +96,7 @@ class Google_Auth_ComputeEngine extends Google_Auth_Abstract
|
|
96 |
$this->token['created'] = time();
|
97 |
return $this->getAccessToken();
|
98 |
} else {
|
99 |
-
throw new
|
100 |
sprintf(
|
101 |
"Error fetching service account access token, message: '%s'",
|
102 |
$response->getResponseBody()
|
@@ -108,11 +108,11 @@ class Google_Auth_ComputeEngine extends Google_Auth_Abstract
|
|
108 |
|
109 |
/**
|
110 |
* Include an accessToken in a given apiHttpRequest.
|
111 |
-
* @param
|
112 |
-
* @return
|
113 |
-
* @throws
|
114 |
*/
|
115 |
-
public function sign(
|
116 |
{
|
117 |
if ($this->isAccessTokenExpired()) {
|
118 |
$this->acquireAccessToken();
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
25 |
* and the appropriate scopes.
|
26 |
* @author Jonathan Parrott <jon.wayne.parrott@gmail.com>
|
27 |
*/
|
28 |
+
class Deconf_Auth_ComputeEngine extends Deconf_Auth_Abstract
|
29 |
{
|
30 |
const METADATA_AUTH_URL =
|
31 |
'http://metadata/computeMetadata/v1/instance/service-accounts/default/token';
|
32 |
private $client;
|
33 |
private $token;
|
34 |
|
35 |
+
public function __construct(Deconf_Client $client, $config = null)
|
36 |
{
|
37 |
$this->client = $client;
|
38 |
}
|
43 |
* (which can modify the request in what ever way fits the auth mechanism)
|
44 |
* and then calls apiCurlIO::makeRequest on the signed request
|
45 |
*
|
46 |
+
* @param Deconf_Http_Request $request
|
47 |
+
* @return Deconf_Http_Request The resulting HTTP response including the
|
48 |
* responseHttpCode, responseHeaders and responseBody.
|
49 |
*/
|
50 |
+
public function authenticatedRequest(Deconf_Http_Request $request)
|
51 |
{
|
52 |
$request = $this->sign($request);
|
53 |
return $this->client->getIo()->makeRequest($request);
|
55 |
|
56 |
/**
|
57 |
* @param string $token
|
58 |
+
* @throws Deconf_Auth_Exception
|
59 |
*/
|
60 |
public function setAccessToken($token)
|
61 |
{
|
62 |
$token = json_decode($token, true);
|
63 |
if ($token == null) {
|
64 |
+
throw new Deconf_Auth_Exception('Could not json decode the token');
|
65 |
}
|
66 |
if (! isset($token['access_token'])) {
|
67 |
+
throw new Deconf_Auth_Exception("Invalid token format");
|
68 |
}
|
69 |
$token['created'] = time();
|
70 |
$this->token = $token;
|
77 |
|
78 |
/**
|
79 |
* Acquires a new access token from the compute engine metadata server.
|
80 |
+
* @throws Deconf_Auth_Exception
|
81 |
*/
|
82 |
public function acquireAccessToken()
|
83 |
{
|
84 |
+
$request = new Deconf_Http_Request(
|
85 |
self::METADATA_AUTH_URL,
|
86 |
'GET',
|
87 |
array(
|
88 |
+
'Metadata-Flavor' => 'Deconf'
|
89 |
)
|
90 |
);
|
91 |
$request->disableGzip();
|
96 |
$this->token['created'] = time();
|
97 |
return $this->getAccessToken();
|
98 |
} else {
|
99 |
+
throw new Deconf_Auth_Exception(
|
100 |
sprintf(
|
101 |
"Error fetching service account access token, message: '%s'",
|
102 |
$response->getResponseBody()
|
108 |
|
109 |
/**
|
110 |
* Include an accessToken in a given apiHttpRequest.
|
111 |
+
* @param Deconf_Http_Request $request
|
112 |
+
* @return Deconf_Http_Request
|
113 |
+
* @throws Deconf_Auth_Exception
|
114 |
*/
|
115 |
+
public function sign(Deconf_Http_Request $request)
|
116 |
{
|
117 |
if ($this->isAccessTokenExpired()) {
|
118 |
$this->acquireAccessToken();
|
tools/src/{Google → Deconf}/Auth/Exception.php
RENAMED
@@ -15,10 +15,10 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
+
class Deconf_Auth_Exception extends Deconf_Exception
|
23 |
{
|
24 |
}
|
tools/src/{Google → Deconf}/Auth/LoginTicket.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,7 +24,7 @@ if (!class_exists('Google_Client')) {
|
|
24 |
*
|
25 |
* @author Brian Eaton <beaton@google.com>
|
26 |
*/
|
27 |
-
class
|
28 |
{
|
29 |
const USER_ATTR = "sub";
|
30 |
|
@@ -48,7 +48,7 @@ class Google_Auth_LoginTicket
|
|
48 |
|
49 |
/**
|
50 |
* Returns the numeric identifier for the user.
|
51 |
-
* @throws
|
52 |
* @return
|
53 |
*/
|
54 |
public function getUserId()
|
@@ -56,7 +56,7 @@ class Google_Auth_LoginTicket
|
|
56 |
if (array_key_exists(self::USER_ATTR, $this->payload)) {
|
57 |
return $this->payload[self::USER_ATTR];
|
58 |
}
|
59 |
-
throw new
|
60 |
}
|
61 |
|
62 |
/**
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
*
|
25 |
* @author Brian Eaton <beaton@google.com>
|
26 |
*/
|
27 |
+
class Deconf_Auth_LoginTicket
|
28 |
{
|
29 |
const USER_ATTR = "sub";
|
30 |
|
48 |
|
49 |
/**
|
50 |
* Returns the numeric identifier for the user.
|
51 |
+
* @throws Deconf_Auth_Exception
|
52 |
* @return
|
53 |
*/
|
54 |
public function getUserId()
|
56 |
if (array_key_exists(self::USER_ATTR, $this->payload)) {
|
57 |
return $this->payload[self::USER_ATTR];
|
58 |
}
|
59 |
+
throw new Deconf_Auth_Exception("No user_id in token");
|
60 |
}
|
61 |
|
62 |
/**
|
tools/src/{Google → Deconf}/Auth/OAuth2.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -23,7 +23,7 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* Authentication class that deals with the OAuth 2 web-server authentication flow
|
24 |
*
|
25 |
*/
|
26 |
-
class
|
27 |
{
|
28 |
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
|
29 |
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
|
@@ -34,7 +34,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
34 |
const OAUTH2_ISSUER = 'accounts.google.com';
|
35 |
const OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com';
|
36 |
|
37 |
-
/** @var
|
38 |
private $assertionCredentials;
|
39 |
|
40 |
/**
|
@@ -48,7 +48,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
48 |
private $token = array();
|
49 |
|
50 |
/**
|
51 |
-
* @var
|
52 |
*/
|
53 |
private $client;
|
54 |
|
@@ -56,7 +56,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
56 |
* Instantiates the class, but does not initiate the login flow, leaving it
|
57 |
* to the discretion of the caller.
|
58 |
*/
|
59 |
-
public function __construct(
|
60 |
{
|
61 |
$this->client = $client;
|
62 |
}
|
@@ -67,11 +67,11 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
67 |
* (which can modify the request in what ever way fits the auth mechanism)
|
68 |
* and then calls apiCurlIO::makeRequest on the signed request
|
69 |
*
|
70 |
-
* @param
|
71 |
-
* @return
|
72 |
* responseHttpCode, responseHeaders and responseBody.
|
73 |
*/
|
74 |
-
public function authenticatedRequest(
|
75 |
{
|
76 |
$request = $this->sign($request);
|
77 |
return $this->client->getIo()->makeRequest($request);
|
@@ -80,13 +80,13 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
80 |
/**
|
81 |
* @param string $code
|
82 |
* @param boolean $crossClient
|
83 |
-
* @throws
|
84 |
* @return string
|
85 |
*/
|
86 |
public function authenticate($code, $crossClient = false)
|
87 |
{
|
88 |
if (strlen($code) == 0) {
|
89 |
-
throw new
|
90 |
}
|
91 |
|
92 |
$arguments = array(
|
@@ -102,7 +102,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
102 |
|
103 |
// We got here from the redirect from a successful authorization grant,
|
104 |
// fetch the access token
|
105 |
-
$request = new
|
106 |
self::OAUTH2_TOKEN_URI,
|
107 |
'POST',
|
108 |
array(),
|
@@ -123,7 +123,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
123 |
$errorText .= ": " . $decodedResponse['error_description'];
|
124 |
}
|
125 |
}
|
126 |
-
throw new
|
127 |
sprintf(
|
128 |
"Error fetching OAuth2 access token, message: '%s'",
|
129 |
$errorText
|
@@ -177,16 +177,16 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
177 |
|
178 |
/**
|
179 |
* @param string $token
|
180 |
-
* @throws
|
181 |
*/
|
182 |
public function setAccessToken($token)
|
183 |
{
|
184 |
$token = json_decode($token, true);
|
185 |
if ($token == null) {
|
186 |
-
throw new
|
187 |
}
|
188 |
if (! isset($token['access_token'])) {
|
189 |
-
throw new
|
190 |
}
|
191 |
$this->token = $token;
|
192 |
}
|
@@ -210,18 +210,18 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
210 |
$this->state = $state;
|
211 |
}
|
212 |
|
213 |
-
public function setAssertionCredentials(
|
214 |
{
|
215 |
$this->assertionCredentials = $creds;
|
216 |
}
|
217 |
|
218 |
/**
|
219 |
* Include an accessToken in a given apiHttpRequest.
|
220 |
-
* @param
|
221 |
-
* @return
|
222 |
-
* @throws
|
223 |
*/
|
224 |
-
public function sign(
|
225 |
{
|
226 |
// add the developer key to the request before signing it
|
227 |
if ($this->client->getClassConfig($this, 'developer_key')) {
|
@@ -246,7 +246,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
246 |
." are not returned for responses that were auto-approved.";
|
247 |
|
248 |
$this->client->getLogger()->error($error);
|
249 |
-
throw new
|
250 |
}
|
251 |
$this->refreshToken($this->token['refresh_token']);
|
252 |
}
|
@@ -281,7 +281,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
281 |
|
282 |
/**
|
283 |
* Fetches a fresh access token with a given assertion token.
|
284 |
-
* @param
|
285 |
* @return void
|
286 |
*/
|
287 |
public function refreshTokenWithAssertion($assertionCredentials = null)
|
@@ -333,7 +333,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
333 |
$this->client->getLogger()->info('OAuth2 access token refresh');
|
334 |
}
|
335 |
|
336 |
-
$http = new
|
337 |
self::OAUTH2_TOKEN_URI,
|
338 |
'POST',
|
339 |
array(),
|
@@ -347,11 +347,11 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
347 |
if (200 == $code) {
|
348 |
$token = json_decode($body, true);
|
349 |
if ($token == null) {
|
350 |
-
throw new
|
351 |
}
|
352 |
|
353 |
if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
|
354 |
-
throw new
|
355 |
}
|
356 |
|
357 |
if (isset($token['id_token'])) {
|
@@ -361,14 +361,14 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
361 |
$this->token['expires_in'] = $token['expires_in'];
|
362 |
$this->token['created'] = time();
|
363 |
} else {
|
364 |
-
throw new
|
365 |
}
|
366 |
}
|
367 |
|
368 |
/**
|
369 |
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
370 |
* token, if a token isn't provided.
|
371 |
-
* @throws
|
372 |
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
373 |
* @return boolean Returns True if the revocation was successful, otherwise False.
|
374 |
*/
|
@@ -384,7 +384,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
384 |
$token = $this->token['access_token'];
|
385 |
}
|
386 |
}
|
387 |
-
$request = new
|
388 |
self::OAUTH2_REVOKE_URI,
|
389 |
'POST',
|
390 |
array(),
|
@@ -432,7 +432,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
432 |
* Retrieve and cache a certificates file.
|
433 |
*
|
434 |
* @param $url string location
|
435 |
-
* @throws
|
436 |
* @return array certificates
|
437 |
*/
|
438 |
public function retrieveCertsFromLocation($url)
|
@@ -443,7 +443,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
443 |
if ($file) {
|
444 |
return json_decode($file, true);
|
445 |
} else {
|
446 |
-
throw new
|
447 |
"Failed to retrieve verification certificates: '" .
|
448 |
$url . "'."
|
449 |
);
|
@@ -452,7 +452,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
452 |
|
453 |
// This relies on makeRequest caching certificate responses.
|
454 |
$request = $this->client->getIo()->makeRequest(
|
455 |
-
new
|
456 |
$url
|
457 |
)
|
458 |
);
|
@@ -462,7 +462,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
462 |
return $certs;
|
463 |
}
|
464 |
}
|
465 |
-
throw new
|
466 |
"Failed to retrieve verification certificates: '" .
|
467 |
$request->getResponseBody() . "'.",
|
468 |
$request->getResponseHttpCode()
|
@@ -477,7 +477,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
477 |
*
|
478 |
* @param $id_token
|
479 |
* @param $audience
|
480 |
-
* @return
|
481 |
*/
|
482 |
public function verifyIdToken($id_token = null, $audience = null)
|
483 |
{
|
@@ -505,7 +505,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
505 |
* @param $required_audience string the expected consumer of the token
|
506 |
* @param [$issuer] the expected issues, defaults to Google
|
507 |
* @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
|
508 |
-
* @throws
|
509 |
* @return mixed token information if valid, false if not
|
510 |
*/
|
511 |
public function verifySignedJwtWithCerts(
|
@@ -522,28 +522,28 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
522 |
|
523 |
$segments = explode(".", $jwt);
|
524 |
if (count($segments) != 3) {
|
525 |
-
throw new
|
526 |
}
|
527 |
$signed = $segments[0] . "." . $segments[1];
|
528 |
-
$signature =
|
529 |
|
530 |
// Parse envelope.
|
531 |
-
$envelope = json_decode(
|
532 |
if (!$envelope) {
|
533 |
-
throw new
|
534 |
}
|
535 |
|
536 |
// Parse token
|
537 |
-
$json_body =
|
538 |
$payload = json_decode($json_body, true);
|
539 |
if (!$payload) {
|
540 |
-
throw new
|
541 |
}
|
542 |
|
543 |
// Check signature
|
544 |
$verified = false;
|
545 |
foreach ($certs as $keyName => $pem) {
|
546 |
-
$public_key = new
|
547 |
if ($public_key->verify($signed, $signature)) {
|
548 |
$verified = true;
|
549 |
break;
|
@@ -551,7 +551,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
551 |
}
|
552 |
|
553 |
if (!$verified) {
|
554 |
-
throw new
|
555 |
}
|
556 |
|
557 |
// Check issued-at timestamp
|
@@ -560,7 +560,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
560 |
$iat = $payload["iat"];
|
561 |
}
|
562 |
if (!$iat) {
|
563 |
-
throw new
|
564 |
}
|
565 |
$earliest = $iat - self::CLOCK_SKEW_SECS;
|
566 |
|
@@ -571,17 +571,17 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
571 |
$exp = $payload["exp"];
|
572 |
}
|
573 |
if (!$exp) {
|
574 |
-
throw new
|
575 |
}
|
576 |
if ($exp >= $now + $max_expiry) {
|
577 |
-
throw new
|
578 |
sprintf("Expiration time too far in future: %s", $json_body)
|
579 |
);
|
580 |
}
|
581 |
|
582 |
$latest = $exp + self::CLOCK_SKEW_SECS;
|
583 |
if ($now < $earliest) {
|
584 |
-
throw new
|
585 |
sprintf(
|
586 |
"Token used too early, %s < %s: %s",
|
587 |
$now,
|
@@ -591,7 +591,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
591 |
);
|
592 |
}
|
593 |
if ($now > $latest) {
|
594 |
-
throw new
|
595 |
sprintf(
|
596 |
"Token used too late, %s > %s: %s",
|
597 |
$now,
|
@@ -605,7 +605,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
605 |
// @see https://developers.google.com/identity/sign-in/web/backend-auth
|
606 |
$iss = $payload['iss'];
|
607 |
if ($issuer && !in_array($iss, (array) $issuer)) {
|
608 |
-
throw new
|
609 |
sprintf(
|
610 |
"Invalid issuer, %s not in %s: %s",
|
611 |
$iss,
|
@@ -618,7 +618,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
618 |
// Check audience
|
619 |
$aud = $payload["aud"];
|
620 |
if ($aud != $required_audience) {
|
621 |
-
throw new
|
622 |
sprintf(
|
623 |
"Wrong recipient, %s != %s:",
|
624 |
$aud,
|
@@ -629,7 +629,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
|
629 |
}
|
630 |
|
631 |
// All good.
|
632 |
-
return new
|
633 |
}
|
634 |
|
635 |
/**
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
23 |
* Authentication class that deals with the OAuth 2 web-server authentication flow
|
24 |
*
|
25 |
*/
|
26 |
+
class Deconf_Auth_OAuth2 extends Deconf_Auth_Abstract
|
27 |
{
|
28 |
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
|
29 |
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
|
34 |
const OAUTH2_ISSUER = 'accounts.google.com';
|
35 |
const OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com';
|
36 |
|
37 |
+
/** @var Deconf_Auth_AssertionCredentials $assertionCredentials */
|
38 |
private $assertionCredentials;
|
39 |
|
40 |
/**
|
48 |
private $token = array();
|
49 |
|
50 |
/**
|
51 |
+
* @var Deconf_Client the base client
|
52 |
*/
|
53 |
private $client;
|
54 |
|
56 |
* Instantiates the class, but does not initiate the login flow, leaving it
|
57 |
* to the discretion of the caller.
|
58 |
*/
|
59 |
+
public function __construct(Deconf_Client $client)
|
60 |
{
|
61 |
$this->client = $client;
|
62 |
}
|
67 |
* (which can modify the request in what ever way fits the auth mechanism)
|
68 |
* and then calls apiCurlIO::makeRequest on the signed request
|
69 |
*
|
70 |
+
* @param Deconf_Http_Request $request
|
71 |
+
* @return Deconf_Http_Request The resulting HTTP response including the
|
72 |
* responseHttpCode, responseHeaders and responseBody.
|
73 |
*/
|
74 |
+
public function authenticatedRequest(Deconf_Http_Request $request)
|
75 |
{
|
76 |
$request = $this->sign($request);
|
77 |
return $this->client->getIo()->makeRequest($request);
|
80 |
/**
|
81 |
* @param string $code
|
82 |
* @param boolean $crossClient
|
83 |
+
* @throws Deconf_Auth_Exception
|
84 |
* @return string
|
85 |
*/
|
86 |
public function authenticate($code, $crossClient = false)
|
87 |
{
|
88 |
if (strlen($code) == 0) {
|
89 |
+
throw new Deconf_Auth_Exception("Invalid code");
|
90 |
}
|
91 |
|
92 |
$arguments = array(
|
102 |
|
103 |
// We got here from the redirect from a successful authorization grant,
|
104 |
// fetch the access token
|
105 |
+
$request = new Deconf_Http_Request(
|
106 |
self::OAUTH2_TOKEN_URI,
|
107 |
'POST',
|
108 |
array(),
|
123 |
$errorText .= ": " . $decodedResponse['error_description'];
|
124 |
}
|
125 |
}
|
126 |
+
throw new Deconf_Auth_Exception(
|
127 |
sprintf(
|
128 |
"Error fetching OAuth2 access token, message: '%s'",
|
129 |
$errorText
|
177 |
|
178 |
/**
|
179 |
* @param string $token
|
180 |
+
* @throws Deconf_Auth_Exception
|
181 |
*/
|
182 |
public function setAccessToken($token)
|
183 |
{
|
184 |
$token = json_decode($token, true);
|
185 |
if ($token == null) {
|
186 |
+
throw new Deconf_Auth_Exception('Could not json decode the token');
|
187 |
}
|
188 |
if (! isset($token['access_token'])) {
|
189 |
+
throw new Deconf_Auth_Exception("Invalid token format");
|
190 |
}
|
191 |
$this->token = $token;
|
192 |
}
|
210 |
$this->state = $state;
|
211 |
}
|
212 |
|
213 |
+
public function setAssertionCredentials(Deconf_Auth_AssertionCredentials $creds)
|
214 |
{
|
215 |
$this->assertionCredentials = $creds;
|
216 |
}
|
217 |
|
218 |
/**
|
219 |
* Include an accessToken in a given apiHttpRequest.
|
220 |
+
* @param Deconf_Http_Request $request
|
221 |
+
* @return Deconf_Http_Request
|
222 |
+
* @throws Deconf_Auth_Exception
|
223 |
*/
|
224 |
+
public function sign(Deconf_Http_Request $request)
|
225 |
{
|
226 |
// add the developer key to the request before signing it
|
227 |
if ($this->client->getClassConfig($this, 'developer_key')) {
|
246 |
." are not returned for responses that were auto-approved.";
|
247 |
|
248 |
$this->client->getLogger()->error($error);
|
249 |
+
throw new Deconf_Auth_Exception($error);
|
250 |
}
|
251 |
$this->refreshToken($this->token['refresh_token']);
|
252 |
}
|
281 |
|
282 |
/**
|
283 |
* Fetches a fresh access token with a given assertion token.
|
284 |
+
* @param Deconf_Auth_AssertionCredentials $assertionCredentials optional.
|
285 |
* @return void
|
286 |
*/
|
287 |
public function refreshTokenWithAssertion($assertionCredentials = null)
|
333 |
$this->client->getLogger()->info('OAuth2 access token refresh');
|
334 |
}
|
335 |
|
336 |
+
$http = new Deconf_Http_Request(
|
337 |
self::OAUTH2_TOKEN_URI,
|
338 |
'POST',
|
339 |
array(),
|
347 |
if (200 == $code) {
|
348 |
$token = json_decode($body, true);
|
349 |
if ($token == null) {
|
350 |
+
throw new Deconf_Auth_Exception("Could not json decode the access token");
|
351 |
}
|
352 |
|
353 |
if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
|
354 |
+
throw new Deconf_Auth_Exception("Invalid token format");
|
355 |
}
|
356 |
|
357 |
if (isset($token['id_token'])) {
|
361 |
$this->token['expires_in'] = $token['expires_in'];
|
362 |
$this->token['created'] = time();
|
363 |
} else {
|
364 |
+
throw new Deconf_Auth_Exception("Error refreshing the OAuth2 token, message: '$body'", $code);
|
365 |
}
|
366 |
}
|
367 |
|
368 |
/**
|
369 |
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
370 |
* token, if a token isn't provided.
|
371 |
+
* @throws Deconf_Auth_Exception
|
372 |
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
373 |
* @return boolean Returns True if the revocation was successful, otherwise False.
|
374 |
*/
|
384 |
$token = $this->token['access_token'];
|
385 |
}
|
386 |
}
|
387 |
+
$request = new Deconf_Http_Request(
|
388 |
self::OAUTH2_REVOKE_URI,
|
389 |
'POST',
|
390 |
array(),
|
432 |
* Retrieve and cache a certificates file.
|
433 |
*
|
434 |
* @param $url string location
|
435 |
+
* @throws Deconf_Auth_Exception
|
436 |
* @return array certificates
|
437 |
*/
|
438 |
public function retrieveCertsFromLocation($url)
|
443 |
if ($file) {
|
444 |
return json_decode($file, true);
|
445 |
} else {
|
446 |
+
throw new Deconf_Auth_Exception(
|
447 |
"Failed to retrieve verification certificates: '" .
|
448 |
$url . "'."
|
449 |
);
|
452 |
|
453 |
// This relies on makeRequest caching certificate responses.
|
454 |
$request = $this->client->getIo()->makeRequest(
|
455 |
+
new Deconf_Http_Request(
|
456 |
$url
|
457 |
)
|
458 |
);
|
462 |
return $certs;
|
463 |
}
|
464 |
}
|
465 |
+
throw new Deconf_Auth_Exception(
|
466 |
"Failed to retrieve verification certificates: '" .
|
467 |
$request->getResponseBody() . "'.",
|
468 |
$request->getResponseHttpCode()
|
477 |
*
|
478 |
* @param $id_token
|
479 |
* @param $audience
|
480 |
+
* @return Deconf_Auth_LoginTicket
|
481 |
*/
|
482 |
public function verifyIdToken($id_token = null, $audience = null)
|
483 |
{
|
505 |
* @param $required_audience string the expected consumer of the token
|
506 |
* @param [$issuer] the expected issues, defaults to Google
|
507 |
* @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
|
508 |
+
* @throws Deconf_Auth_Exception
|
509 |
* @return mixed token information if valid, false if not
|
510 |
*/
|
511 |
public function verifySignedJwtWithCerts(
|
522 |
|
523 |
$segments = explode(".", $jwt);
|
524 |
if (count($segments) != 3) {
|
525 |
+
throw new Deconf_Auth_Exception("Wrong number of segments in token: $jwt");
|
526 |
}
|
527 |
$signed = $segments[0] . "." . $segments[1];
|
528 |
+
$signature = Deconf_Utils::urlSafeB64Decode($segments[2]);
|
529 |
|
530 |
// Parse envelope.
|
531 |
+
$envelope = json_decode(Deconf_Utils::urlSafeB64Decode($segments[0]), true);
|
532 |
if (!$envelope) {
|
533 |
+
throw new Deconf_Auth_Exception("Can't parse token envelope: " . $segments[0]);
|
534 |
}
|
535 |
|
536 |
// Parse token
|
537 |
+
$json_body = Deconf_Utils::urlSafeB64Decode($segments[1]);
|
538 |
$payload = json_decode($json_body, true);
|
539 |
if (!$payload) {
|
540 |
+
throw new Deconf_Auth_Exception("Can't parse token payload: " . $segments[1]);
|
541 |
}
|
542 |
|
543 |
// Check signature
|
544 |
$verified = false;
|
545 |
foreach ($certs as $keyName => $pem) {
|
546 |
+
$public_key = new Deconf_Verifier_Pem($pem);
|
547 |
if ($public_key->verify($signed, $signature)) {
|
548 |
$verified = true;
|
549 |
break;
|
551 |
}
|
552 |
|
553 |
if (!$verified) {
|
554 |
+
throw new Deconf_Auth_Exception("Invalid token signature: $jwt");
|
555 |
}
|
556 |
|
557 |
// Check issued-at timestamp
|
560 |
$iat = $payload["iat"];
|
561 |
}
|
562 |
if (!$iat) {
|
563 |
+
throw new Deconf_Auth_Exception("No issue time in token: $json_body");
|
564 |
}
|
565 |
$earliest = $iat - self::CLOCK_SKEW_SECS;
|
566 |
|
571 |
$exp = $payload["exp"];
|
572 |
}
|
573 |
if (!$exp) {
|
574 |
+
throw new Deconf_Auth_Exception("No expiration time in token: $json_body");
|
575 |
}
|
576 |
if ($exp >= $now + $max_expiry) {
|
577 |
+
throw new Deconf_Auth_Exception(
|
578 |
sprintf("Expiration time too far in future: %s", $json_body)
|
579 |
);
|
580 |
}
|
581 |
|
582 |
$latest = $exp + self::CLOCK_SKEW_SECS;
|
583 |
if ($now < $earliest) {
|
584 |
+
throw new Deconf_Auth_Exception(
|
585 |
sprintf(
|
586 |
"Token used too early, %s < %s: %s",
|
587 |
$now,
|
591 |
);
|
592 |
}
|
593 |
if ($now > $latest) {
|
594 |
+
throw new Deconf_Auth_Exception(
|
595 |
sprintf(
|
596 |
"Token used too late, %s > %s: %s",
|
597 |
$now,
|
605 |
// @see https://developers.google.com/identity/sign-in/web/backend-auth
|
606 |
$iss = $payload['iss'];
|
607 |
if ($issuer && !in_array($iss, (array) $issuer)) {
|
608 |
+
throw new Deconf_Auth_Exception(
|
609 |
sprintf(
|
610 |
"Invalid issuer, %s not in %s: %s",
|
611 |
$iss,
|
618 |
// Check audience
|
619 |
$aud = $payload["aud"];
|
620 |
if ($aud != $required_audience) {
|
621 |
+
throw new Deconf_Auth_Exception(
|
622 |
sprintf(
|
623 |
"Wrong recipient, %s != %s:",
|
624 |
$aud,
|
629 |
}
|
630 |
|
631 |
// All good.
|
632 |
+
return new Deconf_Auth_LoginTicket($envelope, $payload);
|
633 |
}
|
634 |
|
635 |
/**
|
tools/src/{Google → Deconf}/Auth/Simple.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,11 +24,11 @@ if (!class_exists('Google_Client')) {
|
|
24 |
* completely unauthenticated, or by using a Simple API Access developer
|
25 |
* key.
|
26 |
*/
|
27 |
-
class
|
28 |
{
|
29 |
private $client;
|
30 |
|
31 |
-
public function __construct(
|
32 |
{
|
33 |
$this->client = $client;
|
34 |
}
|
@@ -39,17 +39,17 @@ class Google_Auth_Simple extends Google_Auth_Abstract
|
|
39 |
* (which can modify the request in what ever way fits the auth mechanism)
|
40 |
* and then calls apiCurlIO::makeRequest on the signed request
|
41 |
*
|
42 |
-
* @param
|
43 |
-
* @return
|
44 |
* responseHttpCode, responseHeaders and responseBody.
|
45 |
*/
|
46 |
-
public function authenticatedRequest(
|
47 |
{
|
48 |
$request = $this->sign($request);
|
49 |
return $this->io->makeRequest($request);
|
50 |
}
|
51 |
|
52 |
-
public function sign(
|
53 |
{
|
54 |
$key = $this->client->getClassConfig($this, 'developer_key');
|
55 |
if ($key) {
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
* completely unauthenticated, or by using a Simple API Access developer
|
25 |
* key.
|
26 |
*/
|
27 |
+
class Deconf_Auth_Simple extends Deconf_Auth_Abstract
|
28 |
{
|
29 |
private $client;
|
30 |
|
31 |
+
public function __construct(Deconf_Client $client, $config = null)
|
32 |
{
|
33 |
$this->client = $client;
|
34 |
}
|
39 |
* (which can modify the request in what ever way fits the auth mechanism)
|
40 |
* and then calls apiCurlIO::makeRequest on the signed request
|
41 |
*
|
42 |
+
* @param Deconf_Http_Request $request
|
43 |
+
* @return Deconf_Http_Request The resulting HTTP response including the
|
44 |
* responseHttpCode, responseHeaders and responseBody.
|
45 |
*/
|
46 |
+
public function authenticatedRequest(Deconf_Http_Request $request)
|
47 |
{
|
48 |
$request = $this->sign($request);
|
49 |
return $this->io->makeRequest($request);
|
50 |
}
|
51 |
|
52 |
+
public function sign(Deconf_Http_Request $request)
|
53 |
{
|
54 |
$key = $this->client->getClassConfig($this, 'developer_key');
|
55 |
if ($key) {
|
tools/src/{Google → Deconf}/Cache/Abstract.php
RENAMED
@@ -20,10 +20,10 @@
|
|
20 |
*
|
21 |
* @author Chris Chabot <chabotc@google.com>
|
22 |
*/
|
23 |
-
abstract class
|
24 |
{
|
25 |
|
26 |
-
abstract public function __construct(
|
27 |
|
28 |
/**
|
29 |
* Retrieves the data for the given key, or false if they
|
20 |
*
|
21 |
* @author Chris Chabot <chabotc@google.com>
|
22 |
*/
|
23 |
+
abstract class Deconf_Cache_Abstract
|
24 |
{
|
25 |
|
26 |
+
abstract public function __construct(Deconf_Client $client);
|
27 |
|
28 |
/**
|
29 |
* Retrieves the data for the given key, or false if they
|
tools/src/{Google → Deconf}/Cache/Apc.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -27,20 +27,20 @@ if (!class_exists('Google_Client')) {
|
|
27 |
*
|
28 |
* @author Chris Chabot <chabotc@google.com>
|
29 |
*/
|
30 |
-
class
|
31 |
{
|
32 |
/**
|
33 |
-
* @var
|
34 |
*/
|
35 |
private $client;
|
36 |
|
37 |
-
public function __construct(
|
38 |
{
|
39 |
if (! function_exists('apc_add') ) {
|
40 |
$error = "Apc functions not available";
|
41 |
|
42 |
$client->getLogger()->error($error);
|
43 |
-
throw new
|
44 |
}
|
45 |
|
46 |
$this->client = $client;
|
@@ -89,7 +89,7 @@ class Google_Cache_Apc extends Google_Cache_Abstract
|
|
89 |
'APC cache set failed',
|
90 |
array('key' => $key, 'var' => $var)
|
91 |
);
|
92 |
-
throw new
|
93 |
}
|
94 |
|
95 |
$this->client->getLogger()->debug(
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
27 |
*
|
28 |
* @author Chris Chabot <chabotc@google.com>
|
29 |
*/
|
30 |
+
class Deconf_Cache_Apc extends Deconf_Cache_Abstract
|
31 |
{
|
32 |
/**
|
33 |
+
* @var Deconf_Client the current client
|
34 |
*/
|
35 |
private $client;
|
36 |
|
37 |
+
public function __construct(Deconf_Client $client)
|
38 |
{
|
39 |
if (! function_exists('apc_add') ) {
|
40 |
$error = "Apc functions not available";
|
41 |
|
42 |
$client->getLogger()->error($error);
|
43 |
+
throw new Deconf_Cache_Exception($error);
|
44 |
}
|
45 |
|
46 |
$this->client = $client;
|
89 |
'APC cache set failed',
|
90 |
array('key' => $key, 'var' => $var)
|
91 |
);
|
92 |
+
throw new Deconf_Cache_Exception("Couldn't store data");
|
93 |
}
|
94 |
|
95 |
$this->client->getLogger()->debug(
|
tools/src/{Google → Deconf}/Cache/Exception.php
RENAMED
@@ -15,10 +15,10 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
+
class Deconf_Cache_Exception extends Deconf_Exception
|
23 |
{
|
24 |
}
|
tools/src/{Google → Deconf}/Cache/File.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -27,18 +27,18 @@ if (!class_exists('Google_Client')) {
|
|
27 |
*
|
28 |
* @author Chris Chabot <chabotc@google.com>
|
29 |
*/
|
30 |
-
class
|
31 |
{
|
32 |
const MAX_LOCK_RETRIES = 10;
|
33 |
private $path;
|
34 |
private $fh;
|
35 |
|
36 |
/**
|
37 |
-
* @var
|
38 |
*/
|
39 |
private $client;
|
40 |
|
41 |
-
public function __construct(
|
42 |
{
|
43 |
$this->client = $client;
|
44 |
$this->path = $this->client->getClassConfig($this, 'directory');
|
@@ -120,7 +120,7 @@ class Google_Cache_File extends Google_Cache_Abstract
|
|
120 |
'File cache delete failed',
|
121 |
array('key' => $key, 'file' => $file)
|
122 |
);
|
123 |
-
throw new
|
124 |
}
|
125 |
|
126 |
$this->client->getLogger()->debug(
|
@@ -151,7 +151,7 @@ class Google_Cache_File extends Google_Cache_Abstract
|
|
151 |
'File cache creation failed',
|
152 |
array('dir' => $storageDir)
|
153 |
);
|
154 |
-
throw new
|
155 |
}
|
156 |
}
|
157 |
return $storageDir;
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
27 |
*
|
28 |
* @author Chris Chabot <chabotc@google.com>
|
29 |
*/
|
30 |
+
class Deconf_Cache_File extends Deconf_Cache_Abstract
|
31 |
{
|
32 |
const MAX_LOCK_RETRIES = 10;
|
33 |
private $path;
|
34 |
private $fh;
|
35 |
|
36 |
/**
|
37 |
+
* @var Deconf_Client the current client
|
38 |
*/
|
39 |
private $client;
|
40 |
|
41 |
+
public function __construct(Deconf_Client $client)
|
42 |
{
|
43 |
$this->client = $client;
|
44 |
$this->path = $this->client->getClassConfig($this, 'directory');
|
120 |
'File cache delete failed',
|
121 |
array('key' => $key, 'file' => $file)
|
122 |
);
|
123 |
+
throw new Deconf_Cache_Exception("Cache file could not be deleted");
|
124 |
}
|
125 |
|
126 |
$this->client->getLogger()->debug(
|
151 |
'File cache creation failed',
|
152 |
array('dir' => $storageDir)
|
153 |
);
|
154 |
+
throw new Deconf_Cache_Exception("Could not create storage directory: $storageDir");
|
155 |
}
|
156 |
}
|
157 |
return $storageDir;
|
tools/src/{Google → Deconf}/Cache/Memcache.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -29,7 +29,7 @@ if (!class_exists('Google_Client')) {
|
|
29 |
*
|
30 |
* @author Chris Chabot <chabotc@google.com>
|
31 |
*/
|
32 |
-
class
|
33 |
{
|
34 |
private $connection = false;
|
35 |
private $mc = false;
|
@@ -37,17 +37,17 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
|
37 |
private $port;
|
38 |
|
39 |
/**
|
40 |
-
* @var
|
41 |
*/
|
42 |
private $client;
|
43 |
|
44 |
-
public function __construct(
|
45 |
{
|
46 |
if (!function_exists('memcache_connect') && !class_exists("Memcached")) {
|
47 |
$error = "Memcache functions not available";
|
48 |
|
49 |
$client->getLogger()->error($error);
|
50 |
-
throw new
|
51 |
}
|
52 |
|
53 |
$this->client = $client;
|
@@ -63,7 +63,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
|
63 |
$error = "You need to supply a valid memcache host and port";
|
64 |
|
65 |
$client->getLogger()->error($error);
|
66 |
-
throw new
|
67 |
}
|
68 |
}
|
69 |
}
|
@@ -108,7 +108,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
|
108 |
* @inheritDoc
|
109 |
* @param string $key
|
110 |
* @param string $value
|
111 |
-
* @throws
|
112 |
*/
|
113 |
public function set($key, $value)
|
114 |
{
|
@@ -128,7 +128,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
|
128 |
array('key' => $key, 'var' => $data)
|
129 |
);
|
130 |
|
131 |
-
throw new
|
132 |
}
|
133 |
|
134 |
$this->client->getLogger()->debug(
|
@@ -178,7 +178,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
|
178 |
$error = "Couldn't connect to memcache server";
|
179 |
|
180 |
$this->client->getLogger()->error($error);
|
181 |
-
throw new
|
182 |
}
|
183 |
}
|
184 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
29 |
*
|
30 |
* @author Chris Chabot <chabotc@google.com>
|
31 |
*/
|
32 |
+
class Deconf_Cache_Memcache extends Deconf_Cache_Abstract
|
33 |
{
|
34 |
private $connection = false;
|
35 |
private $mc = false;
|
37 |
private $port;
|
38 |
|
39 |
/**
|
40 |
+
* @var Deconf_Client the current client
|
41 |
*/
|
42 |
private $client;
|
43 |
|
44 |
+
public function __construct(Deconf_Client $client)
|
45 |
{
|
46 |
if (!function_exists('memcache_connect') && !class_exists("Memcached")) {
|
47 |
$error = "Memcache functions not available";
|
48 |
|
49 |
$client->getLogger()->error($error);
|
50 |
+
throw new Deconf_Cache_Exception($error);
|
51 |
}
|
52 |
|
53 |
$this->client = $client;
|
63 |
$error = "You need to supply a valid memcache host and port";
|
64 |
|
65 |
$client->getLogger()->error($error);
|
66 |
+
throw new Deconf_Cache_Exception($error);
|
67 |
}
|
68 |
}
|
69 |
}
|
108 |
* @inheritDoc
|
109 |
* @param string $key
|
110 |
* @param string $value
|
111 |
+
* @throws Deconf_Cache_Exception
|
112 |
*/
|
113 |
public function set($key, $value)
|
114 |
{
|
128 |
array('key' => $key, 'var' => $data)
|
129 |
);
|
130 |
|
131 |
+
throw new Deconf_Cache_Exception("Couldn't store data in cache");
|
132 |
}
|
133 |
|
134 |
$this->client->getLogger()->debug(
|
178 |
$error = "Couldn't connect to memcache server";
|
179 |
|
180 |
$this->client->getLogger()->error($error);
|
181 |
+
throw new Deconf_Cache_Exception($error);
|
182 |
}
|
183 |
}
|
184 |
}
|
tools/src/{Google → Deconf}/Cache/Null.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -23,9 +23,9 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* A blank storage class, for cases where caching is not
|
24 |
* required.
|
25 |
*/
|
26 |
-
class
|
27 |
{
|
28 |
-
public function __construct(
|
29 |
{
|
30 |
|
31 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
23 |
* A blank storage class, for cases where caching is not
|
24 |
* required.
|
25 |
*/
|
26 |
+
class Deconf_Cache_Null extends Deconf_Cache_Abstract
|
27 |
{
|
28 |
+
public function __construct(Deconf_Client $client)
|
29 |
{
|
30 |
|
31 |
}
|
tools/src/{Google → Deconf}/Client.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/autoload.php';
|
20 |
}
|
21 |
|
@@ -23,32 +23,32 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* The Google API Client
|
24 |
* https://github.com/google/google-api-php-client
|
25 |
*/
|
26 |
-
class
|
27 |
{
|
28 |
const LIBVER = "1.1.5";
|
29 |
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
30 |
/**
|
31 |
-
* @var
|
32 |
*/
|
33 |
private $auth;
|
34 |
|
35 |
/**
|
36 |
-
* @var
|
37 |
*/
|
38 |
private $io;
|
39 |
|
40 |
/**
|
41 |
-
* @var
|
42 |
*/
|
43 |
private $cache;
|
44 |
|
45 |
/**
|
46 |
-
* @var
|
47 |
*/
|
48 |
private $config;
|
49 |
|
50 |
/**
|
51 |
-
* @var
|
52 |
*/
|
53 |
private $logger;
|
54 |
|
@@ -70,32 +70,32 @@ class Google_Client
|
|
70 |
/**
|
71 |
* Construct the Google Client.
|
72 |
*
|
73 |
-
* @param $config
|
74 |
*/
|
75 |
public function __construct($config = null)
|
76 |
{
|
77 |
if (is_string($config) && strlen($config)) {
|
78 |
-
$config = new
|
79 |
-
} else if ( !($config instanceof
|
80 |
-
$config = new
|
81 |
|
82 |
if ($this->isAppEngine()) {
|
83 |
// Automatically use Memcache if we're in AppEngine.
|
84 |
-
$config->setCacheClass('
|
85 |
}
|
86 |
|
87 |
if (version_compare(phpversion(), "5.3.4", "<=") || $this->isAppEngine()) {
|
88 |
// Automatically disable compress.zlib, as currently unsupported.
|
89 |
-
$config->setClassConfig('
|
90 |
}
|
91 |
}
|
92 |
|
93 |
-
if ($config->getIoClass() ==
|
94 |
if (function_exists('curl_version') && function_exists('curl_exec')
|
95 |
&& !$this->isAppEngine()) {
|
96 |
-
$config->setIoClass("
|
97 |
} else {
|
98 |
-
$config->setIoClass("
|
99 |
}
|
100 |
}
|
101 |
|
@@ -136,7 +136,7 @@ class Google_Client
|
|
136 |
*
|
137 |
* @param string $jsonLocation File location of the project-key.json.
|
138 |
* @param array $scopes The scopes to assert.
|
139 |
-
* @return
|
140 |
* @
|
141 |
*/
|
142 |
public function loadServiceAccountJson($jsonLocation, $scopes)
|
@@ -144,14 +144,14 @@ class Google_Client
|
|
144 |
$data = json_decode(file_get_contents($jsonLocation));
|
145 |
if (isset($data->type) && $data->type == 'service_account') {
|
146 |
// Service Account format.
|
147 |
-
$cred = new
|
148 |
$data->client_email,
|
149 |
$scopes,
|
150 |
$data->private_key
|
151 |
);
|
152 |
return $cred;
|
153 |
} else {
|
154 |
-
throw new
|
155 |
}
|
156 |
}
|
157 |
|
@@ -161,14 +161,14 @@ class Google_Client
|
|
161 |
* the "Download JSON" button on in the Google Developer
|
162 |
* Console.
|
163 |
* @param string $json the configuration json
|
164 |
-
* @throws
|
165 |
*/
|
166 |
public function setAuthConfig($json)
|
167 |
{
|
168 |
$data = json_decode($json);
|
169 |
$key = isset($data->installed) ? 'installed' : 'web';
|
170 |
if (!isset($data->$key)) {
|
171 |
-
throw new
|
172 |
}
|
173 |
$this->setClientId($data->$key->client_id);
|
174 |
$this->setClientSecret($data->$key->client_secret);
|
@@ -190,14 +190,14 @@ class Google_Client
|
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
-
* @throws
|
194 |
* @return array
|
195 |
* @visible For Testing
|
196 |
*/
|
197 |
public function prepareScopes()
|
198 |
{
|
199 |
if (empty($this->requestedScopes)) {
|
200 |
-
throw new
|
201 |
}
|
202 |
$scopes = implode(' ', $this->requestedScopes);
|
203 |
return $scopes;
|
@@ -205,7 +205,7 @@ class Google_Client
|
|
205 |
|
206 |
/**
|
207 |
* Set the OAuth 2.0 access token using the string that resulted from calling createAuthUrl()
|
208 |
-
* or
|
209 |
* @param string $accessToken JSON encoded string containing in the following format:
|
210 |
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
|
211 |
* "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
|
@@ -222,9 +222,9 @@ class Google_Client
|
|
222 |
|
223 |
/**
|
224 |
* Set the authenticator object
|
225 |
-
* @param
|
226 |
*/
|
227 |
-
public function setAuth(
|
228 |
{
|
229 |
$this->config->setAuthClass(get_class($auth));
|
230 |
$this->auth = $auth;
|
@@ -232,9 +232,9 @@ class Google_Client
|
|
232 |
|
233 |
/**
|
234 |
* Set the IO object
|
235 |
-
* @param
|
236 |
*/
|
237 |
-
public function setIo(
|
238 |
{
|
239 |
$this->config->setIoClass(get_class($io));
|
240 |
$this->io = $io;
|
@@ -242,9 +242,9 @@ class Google_Client
|
|
242 |
|
243 |
/**
|
244 |
* Set the Cache object
|
245 |
-
* @param
|
246 |
*/
|
247 |
-
public function setCache(
|
248 |
{
|
249 |
$this->config->setCacheClass(get_class($cache));
|
250 |
$this->cache = $cache;
|
@@ -252,9 +252,9 @@ class Google_Client
|
|
252 |
|
253 |
/**
|
254 |
* Set the Logger object
|
255 |
-
* @param
|
256 |
*/
|
257 |
-
public function setLogger(
|
258 |
{
|
259 |
$this->config->setLoggerClass(get_class($logger));
|
260 |
$this->logger = $logger;
|
@@ -460,7 +460,7 @@ class Google_Client
|
|
460 |
/**
|
461 |
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
462 |
* token, if a token isn't provided.
|
463 |
-
* @throws
|
464 |
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
465 |
* @return boolean Returns True if the revocation was successful, otherwise False.
|
466 |
*/
|
@@ -472,9 +472,9 @@ class Google_Client
|
|
472 |
/**
|
473 |
* Verify an id_token. This method will verify the current id_token, if one
|
474 |
* isn't provided.
|
475 |
-
* @throws
|
476 |
* @param string|null $token The token (id_token) that should be verified.
|
477 |
-
* @return
|
478 |
* successful.
|
479 |
*/
|
480 |
public function verifyIdToken($token = null)
|
@@ -494,15 +494,15 @@ class Google_Client
|
|
494 |
*/
|
495 |
public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null)
|
496 |
{
|
497 |
-
$auth = new
|
498 |
$certs = $auth->retrieveCertsFromLocation($cert_location);
|
499 |
return $auth->verifySignedJwtWithCerts($id_token, $certs, $audience, $issuer, $max_expiry);
|
500 |
}
|
501 |
|
502 |
/**
|
503 |
-
* @param $creds
|
504 |
*/
|
505 |
-
public function setAssertionCredentials(
|
506 |
{
|
507 |
$this->getAuth()->setAssertionCredentials($creds);
|
508 |
}
|
@@ -574,27 +574,27 @@ class Google_Client
|
|
574 |
/**
|
575 |
* Helper method to execute deferred HTTP requests.
|
576 |
*
|
577 |
-
* @param $request
|
578 |
-
* @throws
|
579 |
* @return object of the type of the expected class or array.
|
580 |
*/
|
581 |
public function execute($request)
|
582 |
{
|
583 |
-
if ($request instanceof
|
584 |
$request->setUserAgent(
|
585 |
$this->getApplicationName()
|
586 |
. " " . self::USER_AGENT_SUFFIX
|
587 |
. $this->getLibraryVersion()
|
588 |
);
|
589 |
-
if (!$this->getClassConfig("
|
590 |
$request->enableGzip();
|
591 |
}
|
592 |
$request->maybeMoveParametersToBody();
|
593 |
-
return
|
594 |
-
} else if ($request instanceof
|
595 |
return $request->execute();
|
596 |
} else {
|
597 |
-
throw new
|
598 |
}
|
599 |
}
|
600 |
|
@@ -608,7 +608,7 @@ class Google_Client
|
|
608 |
}
|
609 |
|
610 |
/**
|
611 |
-
* @return
|
612 |
*/
|
613 |
public function getAuth()
|
614 |
{
|
@@ -620,7 +620,7 @@ class Google_Client
|
|
620 |
}
|
621 |
|
622 |
/**
|
623 |
-
* @return
|
624 |
*/
|
625 |
public function getIo()
|
626 |
{
|
@@ -632,7 +632,7 @@ class Google_Client
|
|
632 |
}
|
633 |
|
634 |
/**
|
635 |
-
* @return
|
636 |
*/
|
637 |
public function getCache()
|
638 |
{
|
@@ -644,7 +644,7 @@ class Google_Client
|
|
644 |
}
|
645 |
|
646 |
/**
|
647 |
-
* @return
|
648 |
*/
|
649 |
public function getLogger()
|
650 |
{
|
@@ -671,7 +671,7 @@ class Google_Client
|
|
671 |
|
672 |
/**
|
673 |
* Set configuration specific to a given class.
|
674 |
-
* $config->setClassConfig('
|
675 |
* array('directory' => '/tmp/cache'));
|
676 |
* @param $class string|object - The class name for the configuration
|
677 |
* @param $config string key or an array of configuration values
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/autoload.php';
|
20 |
}
|
21 |
|
23 |
* The Google API Client
|
24 |
* https://github.com/google/google-api-php-client
|
25 |
*/
|
26 |
+
class Deconf_Client
|
27 |
{
|
28 |
const LIBVER = "1.1.5";
|
29 |
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
30 |
/**
|
31 |
+
* @var Deconf_Auth_Abstract $auth
|
32 |
*/
|
33 |
private $auth;
|
34 |
|
35 |
/**
|
36 |
+
* @var Deconf_IO_Abstract $io
|
37 |
*/
|
38 |
private $io;
|
39 |
|
40 |
/**
|
41 |
+
* @var Deconf_Cache_Abstract $cache
|
42 |
*/
|
43 |
private $cache;
|
44 |
|
45 |
/**
|
46 |
+
* @var Deconf_Config $config
|
47 |
*/
|
48 |
private $config;
|
49 |
|
50 |
/**
|
51 |
+
* @var Deconf_Logger_Abstract $logger
|
52 |
*/
|
53 |
private $logger;
|
54 |
|
70 |
/**
|
71 |
* Construct the Google Client.
|
72 |
*
|
73 |
+
* @param $config Deconf_Config or string for the ini file to load
|
74 |
*/
|
75 |
public function __construct($config = null)
|
76 |
{
|
77 |
if (is_string($config) && strlen($config)) {
|
78 |
+
$config = new Deconf_Config($config);
|
79 |
+
} else if ( !($config instanceof Deconf_Config)) {
|
80 |
+
$config = new Deconf_Config();
|
81 |
|
82 |
if ($this->isAppEngine()) {
|
83 |
// Automatically use Memcache if we're in AppEngine.
|
84 |
+
$config->setCacheClass('Deconf_Cache_Memcache');
|
85 |
}
|
86 |
|
87 |
if (version_compare(phpversion(), "5.3.4", "<=") || $this->isAppEngine()) {
|
88 |
// Automatically disable compress.zlib, as currently unsupported.
|
89 |
+
$config->setClassConfig('Deconf_Http_Request', 'disable_gzip', true);
|
90 |
}
|
91 |
}
|
92 |
|
93 |
+
if ($config->getIoClass() == Deconf_Config::USE_AUTO_IO_SELECTION) {
|
94 |
if (function_exists('curl_version') && function_exists('curl_exec')
|
95 |
&& !$this->isAppEngine()) {
|
96 |
+
$config->setIoClass("Deconf_IO_Curl");
|
97 |
} else {
|
98 |
+
$config->setIoClass("Deconf_IO_Stream");
|
99 |
}
|
100 |
}
|
101 |
|
136 |
*
|
137 |
* @param string $jsonLocation File location of the project-key.json.
|
138 |
* @param array $scopes The scopes to assert.
|
139 |
+
* @return Deconf_Auth_AssertionCredentials.
|
140 |
* @
|
141 |
*/
|
142 |
public function loadServiceAccountJson($jsonLocation, $scopes)
|
144 |
$data = json_decode(file_get_contents($jsonLocation));
|
145 |
if (isset($data->type) && $data->type == 'service_account') {
|
146 |
// Service Account format.
|
147 |
+
$cred = new Deconf_Auth_AssertionCredentials(
|
148 |
$data->client_email,
|
149 |
$scopes,
|
150 |
$data->private_key
|
151 |
);
|
152 |
return $cred;
|
153 |
} else {
|
154 |
+
throw new Deconf_Exception("Invalid service account JSON file.");
|
155 |
}
|
156 |
}
|
157 |
|
161 |
* the "Download JSON" button on in the Google Developer
|
162 |
* Console.
|
163 |
* @param string $json the configuration json
|
164 |
+
* @throws Deconf_Exception
|
165 |
*/
|
166 |
public function setAuthConfig($json)
|
167 |
{
|
168 |
$data = json_decode($json);
|
169 |
$key = isset($data->installed) ? 'installed' : 'web';
|
170 |
if (!isset($data->$key)) {
|
171 |
+
throw new Deconf_Exception("Invalid client secret JSON file.");
|
172 |
}
|
173 |
$this->setClientId($data->$key->client_id);
|
174 |
$this->setClientSecret($data->$key->client_secret);
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
+
* @throws Deconf_Auth_Exception
|
194 |
* @return array
|
195 |
* @visible For Testing
|
196 |
*/
|
197 |
public function prepareScopes()
|
198 |
{
|
199 |
if (empty($this->requestedScopes)) {
|
200 |
+
throw new Deconf_Auth_Exception("No scopes specified");
|
201 |
}
|
202 |
$scopes = implode(' ', $this->requestedScopes);
|
203 |
return $scopes;
|
205 |
|
206 |
/**
|
207 |
* Set the OAuth 2.0 access token using the string that resulted from calling createAuthUrl()
|
208 |
+
* or Deconf_Client#getAccessToken().
|
209 |
* @param string $accessToken JSON encoded string containing in the following format:
|
210 |
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
|
211 |
* "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
|
222 |
|
223 |
/**
|
224 |
* Set the authenticator object
|
225 |
+
* @param Deconf_Auth_Abstract $auth
|
226 |
*/
|
227 |
+
public function setAuth(Deconf_Auth_Abstract $auth)
|
228 |
{
|
229 |
$this->config->setAuthClass(get_class($auth));
|
230 |
$this->auth = $auth;
|
232 |
|
233 |
/**
|
234 |
* Set the IO object
|
235 |
+
* @param Deconf_IO_Abstract $io
|
236 |
*/
|
237 |
+
public function setIo(Deconf_IO_Abstract $io)
|
238 |
{
|
239 |
$this->config->setIoClass(get_class($io));
|
240 |
$this->io = $io;
|
242 |
|
243 |
/**
|
244 |
* Set the Cache object
|
245 |
+
* @param Deconf_Cache_Abstract $cache
|
246 |
*/
|
247 |
+
public function setCache(Deconf_Cache_Abstract $cache)
|
248 |
{
|
249 |
$this->config->setCacheClass(get_class($cache));
|
250 |
$this->cache = $cache;
|
252 |
|
253 |
/**
|
254 |
* Set the Logger object
|
255 |
+
* @param Deconf_Logger_Abstract $logger
|
256 |
*/
|
257 |
+
public function setLogger(Deconf_Logger_Abstract $logger)
|
258 |
{
|
259 |
$this->config->setLoggerClass(get_class($logger));
|
260 |
$this->logger = $logger;
|
460 |
/**
|
461 |
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
462 |
* token, if a token isn't provided.
|
463 |
+
* @throws Deconf_Auth_Exception
|
464 |
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
465 |
* @return boolean Returns True if the revocation was successful, otherwise False.
|
466 |
*/
|
472 |
/**
|
473 |
* Verify an id_token. This method will verify the current id_token, if one
|
474 |
* isn't provided.
|
475 |
+
* @throws Deconf_Auth_Exception
|
476 |
* @param string|null $token The token (id_token) that should be verified.
|
477 |
+
* @return Deconf_Auth_LoginTicket Returns an apiLoginTicket if the verification was
|
478 |
* successful.
|
479 |
*/
|
480 |
public function verifyIdToken($token = null)
|
494 |
*/
|
495 |
public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null)
|
496 |
{
|
497 |
+
$auth = new Deconf_Auth_OAuth2($this);
|
498 |
$certs = $auth->retrieveCertsFromLocation($cert_location);
|
499 |
return $auth->verifySignedJwtWithCerts($id_token, $certs, $audience, $issuer, $max_expiry);
|
500 |
}
|
501 |
|
502 |
/**
|
503 |
+
* @param $creds Deconf_Auth_AssertionCredentials
|
504 |
*/
|
505 |
+
public function setAssertionCredentials(Deconf_Auth_AssertionCredentials $creds)
|
506 |
{
|
507 |
$this->getAuth()->setAssertionCredentials($creds);
|
508 |
}
|
574 |
/**
|
575 |
* Helper method to execute deferred HTTP requests.
|
576 |
*
|
577 |
+
* @param $request Deconf_Http_Request|Deconf_Http_Batch
|
578 |
+
* @throws Deconf_Exception
|
579 |
* @return object of the type of the expected class or array.
|
580 |
*/
|
581 |
public function execute($request)
|
582 |
{
|
583 |
+
if ($request instanceof Deconf_Http_Request) {
|
584 |
$request->setUserAgent(
|
585 |
$this->getApplicationName()
|
586 |
. " " . self::USER_AGENT_SUFFIX
|
587 |
. $this->getLibraryVersion()
|
588 |
);
|
589 |
+
if (!$this->getClassConfig("Deconf_Http_Request", "disable_gzip")) {
|
590 |
$request->enableGzip();
|
591 |
}
|
592 |
$request->maybeMoveParametersToBody();
|
593 |
+
return Deconf_Http_REST::execute($this, $request);
|
594 |
+
} else if ($request instanceof Deconf_Http_Batch) {
|
595 |
return $request->execute();
|
596 |
} else {
|
597 |
+
throw new Deconf_Exception("Do not know how to execute this type of object.");
|
598 |
}
|
599 |
}
|
600 |
|
608 |
}
|
609 |
|
610 |
/**
|
611 |
+
* @return Deconf_Auth_Abstract Authentication implementation
|
612 |
*/
|
613 |
public function getAuth()
|
614 |
{
|
620 |
}
|
621 |
|
622 |
/**
|
623 |
+
* @return Deconf_IO_Abstract IO implementation
|
624 |
*/
|
625 |
public function getIo()
|
626 |
{
|
632 |
}
|
633 |
|
634 |
/**
|
635 |
+
* @return Deconf_Cache_Abstract Cache implementation
|
636 |
*/
|
637 |
public function getCache()
|
638 |
{
|
644 |
}
|
645 |
|
646 |
/**
|
647 |
+
* @return Deconf_Logger_Abstract Logger implementation
|
648 |
*/
|
649 |
public function getLogger()
|
650 |
{
|
671 |
|
672 |
/**
|
673 |
* Set configuration specific to a given class.
|
674 |
+
* $config->setClassConfig('Deconf_Cache_File',
|
675 |
* array('directory' => '/tmp/cache'));
|
676 |
* @param $class string|object - The class name for the configuration
|
677 |
* @param $config string key or an array of configuration values
|
tools/src/{Google → Deconf}/Collection.php
RENAMED
@@ -1,15 +1,15 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (!class_exists('
|
4 |
require_once dirname(__FILE__) . '/autoload.php';
|
5 |
}
|
6 |
|
7 |
/**
|
8 |
-
* Extension to the regular
|
9 |
* exposes the items array for iteration, so you can just
|
10 |
* iterate over the object rather than a reference inside.
|
11 |
*/
|
12 |
-
class
|
13 |
{
|
14 |
protected $collection_key = 'items';
|
15 |
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('Deconf_Client')) {
|
4 |
require_once dirname(__FILE__) . '/autoload.php';
|
5 |
}
|
6 |
|
7 |
/**
|
8 |
+
* Extension to the regular Deconf_Model that automatically
|
9 |
* exposes the items array for iteration, so you can just
|
10 |
* iterate over the object rather than a reference inside.
|
11 |
*/
|
12 |
+
class Deconf_Collection extends Deconf_Model implements Iterator, Countable
|
13 |
{
|
14 |
protected $collection_key = 'items';
|
15 |
|
tools/src/{Google → Deconf}/Config.php
RENAMED
@@ -18,7 +18,7 @@
|
|
18 |
/**
|
19 |
* A class to contain the library configuration for the Google API client.
|
20 |
*/
|
21 |
-
class
|
22 |
{
|
23 |
const GZIP_DISABLED = true;
|
24 |
const GZIP_ENABLED = false;
|
@@ -31,7 +31,7 @@ class Google_Config
|
|
31 |
protected $configuration;
|
32 |
|
33 |
/**
|
34 |
-
* Create a new
|
35 |
* local configuration. For example:
|
36 |
* application_name="My App"
|
37 |
*
|
@@ -44,10 +44,10 @@ class Google_Config
|
|
44 |
'application_name' => '',
|
45 |
|
46 |
// Which Authentication, Storage and HTTP IO classes to use.
|
47 |
-
'auth_class' => '
|
48 |
'io_class' => self::USE_AUTO_IO_SELECTION,
|
49 |
-
'cache_class' => '
|
50 |
-
'logger_class' => '
|
51 |
|
52 |
// Don't change these unless you're working against a special development
|
53 |
// or testing environment.
|
@@ -55,25 +55,25 @@ class Google_Config
|
|
55 |
|
56 |
// Definition of class specific values, like file paths and so on.
|
57 |
'classes' => array(
|
58 |
-
'
|
59 |
'request_timeout_seconds' => 100,
|
60 |
),
|
61 |
-
'
|
62 |
'disable_proxy_workaround' => false,
|
63 |
'options' => null,
|
64 |
),
|
65 |
-
'
|
66 |
'level' => 'debug',
|
67 |
'log_format' => "[%datetime%] %level%: %message% %context%\n",
|
68 |
'date_format' => 'd/M/Y:H:i:s O',
|
69 |
'allow_newlines' => true
|
70 |
),
|
71 |
-
'
|
72 |
'file' => 'php://stdout',
|
73 |
'mode' => 0640,
|
74 |
'lock' => false,
|
75 |
),
|
76 |
-
'
|
77 |
// Disable the use of gzip on calls if set to true. Defaults to false.
|
78 |
'disable_gzip' => self::GZIP_ENABLED,
|
79 |
|
@@ -85,7 +85,7 @@ class Google_Config
|
|
85 |
),
|
86 |
// If you want to pass in OAuth 2.0 settings, they will need to be
|
87 |
// structured like this.
|
88 |
-
'
|
89 |
// Keys for OAuth 2.0 access, see the API console at
|
90 |
// https://developers.google.com/console
|
91 |
'client_id' => '',
|
@@ -108,7 +108,7 @@ class Google_Config
|
|
108 |
'federated_signon_certs_url' =>
|
109 |
'https://www.googleapis.com/oauth2/v1/certs',
|
110 |
),
|
111 |
-
'
|
112 |
// Delays are specified in seconds
|
113 |
'initial_delay' => 1,
|
114 |
'max_delay' => 60,
|
@@ -121,7 +121,7 @@ class Google_Config
|
|
121 |
// Maximum number of retries allowed
|
122 |
'retries' => 0
|
123 |
),
|
124 |
-
'
|
125 |
'retry_map' => array(
|
126 |
'500' => self::TASK_RETRY_ALWAYS,
|
127 |
'503' => self::TASK_RETRY_ALWAYS,
|
@@ -129,7 +129,7 @@ class Google_Config
|
|
129 |
'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS
|
130 |
)
|
131 |
),
|
132 |
-
'
|
133 |
'retry_map' => !extension_loaded('curl') ? array() : array(
|
134 |
CURLE_COULDNT_RESOLVE_HOST => self::TASK_RETRY_ALWAYS,
|
135 |
CURLE_COULDNT_CONNECT => self::TASK_RETRY_ALWAYS,
|
@@ -139,8 +139,8 @@ class Google_Config
|
|
139 |
)
|
140 |
),
|
141 |
// Set a default directory for the file cache.
|
142 |
-
'
|
143 |
-
'directory' => sys_get_temp_dir() . '/
|
144 |
)
|
145 |
),
|
146 |
);
|
@@ -158,7 +158,7 @@ class Google_Config
|
|
158 |
|
159 |
/**
|
160 |
* Set configuration specific to a given class.
|
161 |
-
* $config->setClassConfig('
|
162 |
* array('directory' => '/tmp/cache'));
|
163 |
* @param $class string The class name for the configuration
|
164 |
* @param $config string key or an array of configuration values
|
@@ -387,7 +387,7 @@ class Google_Config
|
|
387 |
* restrict sign-in to accounts at that domain.
|
388 |
*
|
389 |
* This should not be used to ensure security on your application - check
|
390 |
-
* the hd values within an id token (@see
|
391 |
* in to ensure that the user is from the domain you were expecting.
|
392 |
*
|
393 |
* @param $hd string - the domain to use.
|
18 |
/**
|
19 |
* A class to contain the library configuration for the Google API client.
|
20 |
*/
|
21 |
+
class Deconf_Config
|
22 |
{
|
23 |
const GZIP_DISABLED = true;
|
24 |
const GZIP_ENABLED = false;
|
31 |
protected $configuration;
|
32 |
|
33 |
/**
|
34 |
+
* Create a new Deconf_Config. Can accept an ini file location with the
|
35 |
* local configuration. For example:
|
36 |
* application_name="My App"
|
37 |
*
|
44 |
'application_name' => '',
|
45 |
|
46 |
// Which Authentication, Storage and HTTP IO classes to use.
|
47 |
+
'auth_class' => 'Deconf_Auth_OAuth2',
|
48 |
'io_class' => self::USE_AUTO_IO_SELECTION,
|
49 |
+
'cache_class' => 'Deconf_Cache_File',
|
50 |
+
'logger_class' => 'Deconf_Logger_Null',
|
51 |
|
52 |
// Don't change these unless you're working against a special development
|
53 |
// or testing environment.
|
55 |
|
56 |
// Definition of class specific values, like file paths and so on.
|
57 |
'classes' => array(
|
58 |
+
'Deconf_IO_Abstract' => array(
|
59 |
'request_timeout_seconds' => 100,
|
60 |
),
|
61 |
+
'Deconf_IO_Curl' => array(
|
62 |
'disable_proxy_workaround' => false,
|
63 |
'options' => null,
|
64 |
),
|
65 |
+
'Deconf_Logger_Abstract' => array(
|
66 |
'level' => 'debug',
|
67 |
'log_format' => "[%datetime%] %level%: %message% %context%\n",
|
68 |
'date_format' => 'd/M/Y:H:i:s O',
|
69 |
'allow_newlines' => true
|
70 |
),
|
71 |
+
'Deconf_Logger_File' => array(
|
72 |
'file' => 'php://stdout',
|
73 |
'mode' => 0640,
|
74 |
'lock' => false,
|
75 |
),
|
76 |
+
'Deconf_Http_Request' => array(
|
77 |
// Disable the use of gzip on calls if set to true. Defaults to false.
|
78 |
'disable_gzip' => self::GZIP_ENABLED,
|
79 |
|
85 |
),
|
86 |
// If you want to pass in OAuth 2.0 settings, they will need to be
|
87 |
// structured like this.
|
88 |
+
'Deconf_Auth_OAuth2' => array(
|
89 |
// Keys for OAuth 2.0 access, see the API console at
|
90 |
// https://developers.google.com/console
|
91 |
'client_id' => '',
|
108 |
'federated_signon_certs_url' =>
|
109 |
'https://www.googleapis.com/oauth2/v1/certs',
|
110 |
),
|
111 |
+
'Deconf_Task_Runner' => array(
|
112 |
// Delays are specified in seconds
|
113 |
'initial_delay' => 1,
|
114 |
'max_delay' => 60,
|
121 |
// Maximum number of retries allowed
|
122 |
'retries' => 0
|
123 |
),
|
124 |
+
'Deconf_Service_Exception' => array(
|
125 |
'retry_map' => array(
|
126 |
'500' => self::TASK_RETRY_ALWAYS,
|
127 |
'503' => self::TASK_RETRY_ALWAYS,
|
129 |
'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS
|
130 |
)
|
131 |
),
|
132 |
+
'Deconf_IO_Exception' => array(
|
133 |
'retry_map' => !extension_loaded('curl') ? array() : array(
|
134 |
CURLE_COULDNT_RESOLVE_HOST => self::TASK_RETRY_ALWAYS,
|
135 |
CURLE_COULDNT_CONNECT => self::TASK_RETRY_ALWAYS,
|
139 |
)
|
140 |
),
|
141 |
// Set a default directory for the file cache.
|
142 |
+
'Deconf_Cache_File' => array(
|
143 |
+
'directory' => sys_get_temp_dir() . '/Deconf_Client'
|
144 |
)
|
145 |
),
|
146 |
);
|
158 |
|
159 |
/**
|
160 |
* Set configuration specific to a given class.
|
161 |
+
* $config->setClassConfig('Deconf_Cache_File',
|
162 |
* array('directory' => '/tmp/cache'));
|
163 |
* @param $class string The class name for the configuration
|
164 |
* @param $config string key or an array of configuration values
|
387 |
* restrict sign-in to accounts at that domain.
|
388 |
*
|
389 |
* This should not be used to ensure security on your application - check
|
390 |
+
* the hd values within an id token (@see Deconf_Auth_LoginTicket) after sign
|
391 |
* in to ensure that the user is from the domain you were expecting.
|
392 |
*
|
393 |
* @param $hd string - the domain to use.
|
tools/src/{Google → Deconf}/Exception.php
RENAMED
@@ -15,6 +15,6 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
class Deconf_Exception extends Exception
|
19 |
{
|
20 |
}
|
tools/src/{Google → Deconf}/Http/Batch.php
RENAMED
@@ -15,14 +15,14 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* Class to handle batched requests to the Google API service.
|
24 |
*/
|
25 |
-
class
|
26 |
{
|
27 |
/** @var string Multipart Boundary. */
|
28 |
private $boundary;
|
@@ -30,7 +30,7 @@ class Google_Http_Batch
|
|
30 |
/** @var array service requests to be executed. */
|
31 |
private $requests = array();
|
32 |
|
33 |
-
/** @var
|
34 |
private $client;
|
35 |
|
36 |
private $expected_classes = array();
|
@@ -39,7 +39,7 @@ class Google_Http_Batch
|
|
39 |
|
40 |
private $batch_path;
|
41 |
|
42 |
-
public function __construct(
|
43 |
{
|
44 |
$this->client = $client;
|
45 |
$this->root_url = rtrim($rootUrl ? $rootUrl : $this->client->getBasePath(), '/');
|
@@ -49,7 +49,7 @@ class Google_Http_Batch
|
|
49 |
$this->boundary = str_replace('"', '', $boundary);
|
50 |
}
|
51 |
|
52 |
-
public function add(
|
53 |
{
|
54 |
if (false == $key) {
|
55 |
$key = mt_rand();
|
@@ -62,7 +62,7 @@ class Google_Http_Batch
|
|
62 |
{
|
63 |
$body = '';
|
64 |
|
65 |
-
/** @var
|
66 |
foreach ($this->requests as $key => $req) {
|
67 |
$body .= "--{$this->boundary}\n";
|
68 |
$body .= $req->toBatchString($key) . "\n\n";
|
@@ -72,7 +72,7 @@ class Google_Http_Batch
|
|
72 |
$body .= "--{$this->boundary}--";
|
73 |
|
74 |
$url = $this->root_url . '/' . $this->batch_path;
|
75 |
-
$httpRequest = new
|
76 |
$httpRequest->setRequestHeaders(
|
77 |
array('Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)
|
78 |
);
|
@@ -83,7 +83,7 @@ class Google_Http_Batch
|
|
83 |
return $this->parseResponse($response);
|
84 |
}
|
85 |
|
86 |
-
public function parseResponse(
|
87 |
{
|
88 |
$contentType = $response->getResponseHeader('content-type');
|
89 |
$contentType = explode(';', $contentType);
|
@@ -112,7 +112,7 @@ class Google_Http_Batch
|
|
112 |
$status = $status[1];
|
113 |
|
114 |
list($partHeaders, $partBody) = $this->client->getIo()->ParseHttpResponse($part, false);
|
115 |
-
$response = new
|
116 |
$response->setResponseHttpCode($status);
|
117 |
$response->setResponseHeaders($partHeaders);
|
118 |
$response->setResponseBody($partBody);
|
@@ -127,9 +127,9 @@ class Google_Http_Batch
|
|
127 |
}
|
128 |
|
129 |
try {
|
130 |
-
$response =
|
131 |
$responses[$key] = $response;
|
132 |
-
} catch (
|
133 |
// Store the exception as the response, so successful responses
|
134 |
// can be processed.
|
135 |
$responses[$key] = $e;
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* Class to handle batched requests to the Google API service.
|
24 |
*/
|
25 |
+
class Deconf_Http_Batch
|
26 |
{
|
27 |
/** @var string Multipart Boundary. */
|
28 |
private $boundary;
|
30 |
/** @var array service requests to be executed. */
|
31 |
private $requests = array();
|
32 |
|
33 |
+
/** @var Deconf_Client */
|
34 |
private $client;
|
35 |
|
36 |
private $expected_classes = array();
|
39 |
|
40 |
private $batch_path;
|
41 |
|
42 |
+
public function __construct(Deconf_Client $client, $boundary = false, $rootUrl = '', $batchPath = '')
|
43 |
{
|
44 |
$this->client = $client;
|
45 |
$this->root_url = rtrim($rootUrl ? $rootUrl : $this->client->getBasePath(), '/');
|
49 |
$this->boundary = str_replace('"', '', $boundary);
|
50 |
}
|
51 |
|
52 |
+
public function add(Deconf_Http_Request $request, $key = false)
|
53 |
{
|
54 |
if (false == $key) {
|
55 |
$key = mt_rand();
|
62 |
{
|
63 |
$body = '';
|
64 |
|
65 |
+
/** @var Deconf_Http_Request $req */
|
66 |
foreach ($this->requests as $key => $req) {
|
67 |
$body .= "--{$this->boundary}\n";
|
68 |
$body .= $req->toBatchString($key) . "\n\n";
|
72 |
$body .= "--{$this->boundary}--";
|
73 |
|
74 |
$url = $this->root_url . '/' . $this->batch_path;
|
75 |
+
$httpRequest = new Deconf_Http_Request($url, 'POST');
|
76 |
$httpRequest->setRequestHeaders(
|
77 |
array('Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)
|
78 |
);
|
83 |
return $this->parseResponse($response);
|
84 |
}
|
85 |
|
86 |
+
public function parseResponse(Deconf_Http_Request $response)
|
87 |
{
|
88 |
$contentType = $response->getResponseHeader('content-type');
|
89 |
$contentType = explode(';', $contentType);
|
112 |
$status = $status[1];
|
113 |
|
114 |
list($partHeaders, $partBody) = $this->client->getIo()->ParseHttpResponse($part, false);
|
115 |
+
$response = new Deconf_Http_Request("");
|
116 |
$response->setResponseHttpCode($status);
|
117 |
$response->setResponseHeaders($partHeaders);
|
118 |
$response->setResponseBody($partBody);
|
127 |
}
|
128 |
|
129 |
try {
|
130 |
+
$response = Deconf_Http_REST::decodeHttpResponse($response, $this->client);
|
131 |
$responses[$key] = $response;
|
132 |
+
} catch (Deconf_Service_Exception $e) {
|
133 |
// Store the exception as the response, so successful responses
|
134 |
// can be processed.
|
135 |
$responses[$key] = $e;
|
tools/src/{Google → Deconf}/Http/CacheParser.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -23,7 +23,7 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* Implement the caching directives specified in rfc2616. This
|
24 |
* implementation is guided by the guidance offered in rfc2616-sec13.
|
25 |
*/
|
26 |
-
class
|
27 |
{
|
28 |
public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD');
|
29 |
public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301');
|
@@ -32,11 +32,11 @@ class Google_Http_CacheParser
|
|
32 |
* Check if an HTTP request can be cached by a private local cache.
|
33 |
*
|
34 |
* @static
|
35 |
-
* @param
|
36 |
* @return bool True if the request is cacheable.
|
37 |
* False if the request is uncacheable.
|
38 |
*/
|
39 |
-
public static function isRequestCacheable(
|
40 |
{
|
41 |
$method = $resp->getRequestMethod();
|
42 |
if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) {
|
@@ -58,11 +58,11 @@ class Google_Http_CacheParser
|
|
58 |
* Check if an HTTP response can be cached by a private local cache.
|
59 |
*
|
60 |
* @static
|
61 |
-
* @param
|
62 |
* @return bool True if the response is cacheable.
|
63 |
* False if the response is un-cacheable.
|
64 |
*/
|
65 |
-
public static function isResponseCacheable(
|
66 |
{
|
67 |
// First, check if the HTTP request was cacheable before inspecting the
|
68 |
// HTTP response.
|
@@ -110,11 +110,11 @@ class Google_Http_CacheParser
|
|
110 |
|
111 |
/**
|
112 |
* @static
|
113 |
-
* @param
|
114 |
* @return bool True if the HTTP response is considered to be expired.
|
115 |
* False if it is considered to be fresh.
|
116 |
*/
|
117 |
-
public static function isExpired(
|
118 |
{
|
119 |
// HTTP/1.1 clients and caches MUST treat other invalid date formats,
|
120 |
// especially including the value “0”, as in the past.
|
@@ -149,7 +149,7 @@ class Google_Http_CacheParser
|
|
149 |
// We can't default this to now, as that means future cache reads
|
150 |
// will always pass with the logic below, so we will require a
|
151 |
// date be injected if not supplied.
|
152 |
-
throw new
|
153 |
}
|
154 |
|
155 |
if (false == $freshnessLifetime && isset($responseHeaders['expires'])) {
|
@@ -172,10 +172,10 @@ class Google_Http_CacheParser
|
|
172 |
/**
|
173 |
* Determine if a cache entry should be revalidated with by the origin.
|
174 |
*
|
175 |
-
* @param
|
176 |
* @return bool True if the entry is expired, else return false.
|
177 |
*/
|
178 |
-
public static function mustRevalidate(
|
179 |
{
|
180 |
// [13.3] When a cache has a stale entry that it would like to use as a
|
181 |
// response to a client's request, it first has to check with the origin
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
23 |
* Implement the caching directives specified in rfc2616. This
|
24 |
* implementation is guided by the guidance offered in rfc2616-sec13.
|
25 |
*/
|
26 |
+
class Deconf_Http_CacheParser
|
27 |
{
|
28 |
public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD');
|
29 |
public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301');
|
32 |
* Check if an HTTP request can be cached by a private local cache.
|
33 |
*
|
34 |
* @static
|
35 |
+
* @param Deconf_Http_Request $resp
|
36 |
* @return bool True if the request is cacheable.
|
37 |
* False if the request is uncacheable.
|
38 |
*/
|
39 |
+
public static function isRequestCacheable(Deconf_Http_Request $resp)
|
40 |
{
|
41 |
$method = $resp->getRequestMethod();
|
42 |
if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) {
|
58 |
* Check if an HTTP response can be cached by a private local cache.
|
59 |
*
|
60 |
* @static
|
61 |
+
* @param Deconf_Http_Request $resp
|
62 |
* @return bool True if the response is cacheable.
|
63 |
* False if the response is un-cacheable.
|
64 |
*/
|
65 |
+
public static function isResponseCacheable(Deconf_Http_Request $resp)
|
66 |
{
|
67 |
// First, check if the HTTP request was cacheable before inspecting the
|
68 |
// HTTP response.
|
110 |
|
111 |
/**
|
112 |
* @static
|
113 |
+
* @param Deconf_Http_Request $resp
|
114 |
* @return bool True if the HTTP response is considered to be expired.
|
115 |
* False if it is considered to be fresh.
|
116 |
*/
|
117 |
+
public static function isExpired(Deconf_Http_Request $resp)
|
118 |
{
|
119 |
// HTTP/1.1 clients and caches MUST treat other invalid date formats,
|
120 |
// especially including the value “0”, as in the past.
|
149 |
// We can't default this to now, as that means future cache reads
|
150 |
// will always pass with the logic below, so we will require a
|
151 |
// date be injected if not supplied.
|
152 |
+
throw new Deconf_Exception("All cacheable requests must have creation dates.");
|
153 |
}
|
154 |
|
155 |
if (false == $freshnessLifetime && isset($responseHeaders['expires'])) {
|
172 |
/**
|
173 |
* Determine if a cache entry should be revalidated with by the origin.
|
174 |
*
|
175 |
+
* @param Deconf_Http_Request $response
|
176 |
* @return bool True if the entry is expired, else return false.
|
177 |
*/
|
178 |
+
public static function mustRevalidate(Deconf_Http_Request $response)
|
179 |
{
|
180 |
// [13.3] When a cache has a stale entry that it would like to use as a
|
181 |
// response to a client's request, it first has to check with the origin
|
tools/src/{Google → Deconf}/Http/MediaFileUpload.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -23,7 +23,7 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* Manage large file uploads, which may be media but can be any type
|
24 |
* of sizable data.
|
25 |
*/
|
26 |
-
class
|
27 |
{
|
28 |
const UPLOAD_MEDIA_TYPE = 'media';
|
29 |
const UPLOAD_MULTIPART_TYPE = 'multipart';
|
@@ -50,10 +50,10 @@ class Google_Http_MediaFileUpload
|
|
50 |
/** @var int $progress */
|
51 |
private $progress;
|
52 |
|
53 |
-
/** @var
|
54 |
private $client;
|
55 |
|
56 |
-
/** @var
|
57 |
private $request;
|
58 |
|
59 |
/** @var string */
|
@@ -73,8 +73,8 @@ class Google_Http_MediaFileUpload
|
|
73 |
* only used if resumable=True
|
74 |
*/
|
75 |
public function __construct(
|
76 |
-
|
77 |
-
|
78 |
$mimeType,
|
79 |
$data,
|
80 |
$resumable = false,
|
@@ -129,14 +129,14 @@ class Google_Http_MediaFileUpload
|
|
129 |
* Sends a PUT-Request to google drive and parses the response,
|
130 |
* setting the appropiate variables from the response()
|
131 |
*
|
132 |
-
* @param
|
133 |
*
|
134 |
* @return false|mixed false when the upload is unfinished or the decoded http response
|
135 |
*
|
136 |
*/
|
137 |
-
private function makePutRequest(
|
138 |
{
|
139 |
-
if ($this->client->getClassConfig("
|
140 |
$httpRequest->enableGzip();
|
141 |
} else {
|
142 |
$httpRequest->disableGzip();
|
@@ -161,7 +161,7 @@ class Google_Http_MediaFileUpload
|
|
161 |
// No problems, but upload not complete.
|
162 |
return false;
|
163 |
} else {
|
164 |
-
return
|
165 |
}
|
166 |
}
|
167 |
|
@@ -187,7 +187,7 @@ class Google_Http_MediaFileUpload
|
|
187 |
'expect' => '',
|
188 |
);
|
189 |
|
190 |
-
$httpRequest = new
|
191 |
$this->resumeUri,
|
192 |
'PUT',
|
193 |
$headers,
|
@@ -207,7 +207,7 @@ class Google_Http_MediaFileUpload
|
|
207 |
'content-range' => "bytes */$this->size",
|
208 |
'content-length' => 0,
|
209 |
);
|
210 |
-
$httpRequest = new
|
211 |
$this->resumeUri,
|
212 |
'PUT',
|
213 |
$headers
|
@@ -304,7 +304,7 @@ class Google_Http_MediaFileUpload
|
|
304 |
if ($body) {
|
305 |
$headers = array(
|
306 |
'content-type' => 'application/json; charset=UTF-8',
|
307 |
-
'content-length' =>
|
308 |
'x-upload-content-type' => $this->mimeType,
|
309 |
'x-upload-content-length' => $this->size,
|
310 |
'expect' => '',
|
@@ -331,7 +331,7 @@ class Google_Http_MediaFileUpload
|
|
331 |
|
332 |
$error = "Failed to start the resumable upload (HTTP {$message})";
|
333 |
$this->client->getLogger()->error($error);
|
334 |
-
throw new
|
335 |
}
|
336 |
|
337 |
public function setChunkSize($chunkSize)
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
23 |
* Manage large file uploads, which may be media but can be any type
|
24 |
* of sizable data.
|
25 |
*/
|
26 |
+
class Deconf_Http_MediaFileUpload
|
27 |
{
|
28 |
const UPLOAD_MEDIA_TYPE = 'media';
|
29 |
const UPLOAD_MULTIPART_TYPE = 'multipart';
|
50 |
/** @var int $progress */
|
51 |
private $progress;
|
52 |
|
53 |
+
/** @var Deconf_Client */
|
54 |
private $client;
|
55 |
|
56 |
+
/** @var Deconf_Http_Request */
|
57 |
private $request;
|
58 |
|
59 |
/** @var string */
|
73 |
* only used if resumable=True
|
74 |
*/
|
75 |
public function __construct(
|
76 |
+
Deconf_Client $client,
|
77 |
+
Deconf_Http_Request $request,
|
78 |
$mimeType,
|
79 |
$data,
|
80 |
$resumable = false,
|
129 |
* Sends a PUT-Request to google drive and parses the response,
|
130 |
* setting the appropiate variables from the response()
|
131 |
*
|
132 |
+
* @param Deconf_Http_Request $httpRequest the Reuqest which will be send
|
133 |
*
|
134 |
* @return false|mixed false when the upload is unfinished or the decoded http response
|
135 |
*
|
136 |
*/
|
137 |
+
private function makePutRequest(Deconf_Http_Request $httpRequest)
|
138 |
{
|
139 |
+
if ($this->client->getClassConfig("Deconf_Http_Request", "enable_gzip_for_uploads")) {
|
140 |
$httpRequest->enableGzip();
|
141 |
} else {
|
142 |
$httpRequest->disableGzip();
|
161 |
// No problems, but upload not complete.
|
162 |
return false;
|
163 |
} else {
|
164 |
+
return Deconf_Http_REST::decodeHttpResponse($response, $this->client);
|
165 |
}
|
166 |
}
|
167 |
|
187 |
'expect' => '',
|
188 |
);
|
189 |
|
190 |
+
$httpRequest = new Deconf_Http_Request(
|
191 |
$this->resumeUri,
|
192 |
'PUT',
|
193 |
$headers,
|
207 |
'content-range' => "bytes */$this->size",
|
208 |
'content-length' => 0,
|
209 |
);
|
210 |
+
$httpRequest = new Deconf_Http_Request(
|
211 |
$this->resumeUri,
|
212 |
'PUT',
|
213 |
$headers
|
304 |
if ($body) {
|
305 |
$headers = array(
|
306 |
'content-type' => 'application/json; charset=UTF-8',
|
307 |
+
'content-length' => Deconf_Utils::getStrLen($body),
|
308 |
'x-upload-content-type' => $this->mimeType,
|
309 |
'x-upload-content-length' => $this->size,
|
310 |
'expect' => '',
|
331 |
|
332 |
$error = "Failed to start the resumable upload (HTTP {$message})";
|
333 |
$this->client->getLogger()->error($error);
|
334 |
+
throw new Deconf_Exception($error);
|
335 |
}
|
336 |
|
337 |
public function setChunkSize($chunkSize)
|
tools/src/{Google → Deconf}/Http/REST.php
RENAMED
@@ -15,28 +15,28 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* This class implements the RESTful transport of apiServiceRequest()'s
|
24 |
*/
|
25 |
-
class
|
26 |
{
|
27 |
/**
|
28 |
-
* Executes a
|
29 |
* when errors occur.
|
30 |
*
|
31 |
-
* @param
|
32 |
-
* @param
|
33 |
* @return array decoded result
|
34 |
-
* @throws
|
35 |
* invalid or malformed post body, invalid url)
|
36 |
*/
|
37 |
-
public static function execute(
|
38 |
{
|
39 |
-
$runner = new
|
40 |
$client,
|
41 |
sprintf('%s %s', $req->getRequestMethod(), $req->getUrl()),
|
42 |
array(get_class(), 'doExecute'),
|
@@ -47,15 +47,15 @@ class Google_Http_REST
|
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
-
* Executes a
|
51 |
*
|
52 |
-
* @param
|
53 |
-
* @param
|
54 |
* @return array decoded result
|
55 |
-
* @throws
|
56 |
* invalid or malformed post body, invalid url)
|
57 |
*/
|
58 |
-
public static function doExecute(
|
59 |
{
|
60 |
$httpRequest = $client->getIo()->makeRequest($req);
|
61 |
$httpRequest->setExpectedClass($req->getExpectedClass());
|
@@ -65,12 +65,12 @@ class Google_Http_REST
|
|
65 |
/**
|
66 |
* Decode an HTTP Response.
|
67 |
* @static
|
68 |
-
* @throws
|
69 |
-
* @param
|
70 |
-
* @param
|
71 |
* @return mixed|null
|
72 |
*/
|
73 |
-
public static function decodeHttpResponse($response,
|
74 |
{
|
75 |
$code = $response->getResponseHttpCode();
|
76 |
$body = $response->getResponseBody();
|
@@ -103,11 +103,11 @@ class Google_Http_REST
|
|
103 |
);
|
104 |
|
105 |
$map = $client->getClassConfig(
|
106 |
-
'
|
107 |
'retry_map'
|
108 |
);
|
109 |
}
|
110 |
-
throw new
|
111 |
}
|
112 |
|
113 |
// Only attempt to decode the response, if the response code wasn't (204) 'no content'
|
@@ -122,7 +122,7 @@ class Google_Http_REST
|
|
122 |
if ($client) {
|
123 |
$client->getLogger()->error($error);
|
124 |
}
|
125 |
-
throw new
|
126 |
}
|
127 |
|
128 |
if ($response->getExpectedClass()) {
|
@@ -165,7 +165,7 @@ class Google_Http_REST
|
|
165 |
}
|
166 |
|
167 |
if (count($uriTemplateVars)) {
|
168 |
-
$uriTemplateParser = new
|
169 |
$requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars);
|
170 |
}
|
171 |
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* This class implements the RESTful transport of apiServiceRequest()'s
|
24 |
*/
|
25 |
+
class Deconf_Http_REST
|
26 |
{
|
27 |
/**
|
28 |
+
* Executes a Deconf_Http_Request and (if applicable) automatically retries
|
29 |
* when errors occur.
|
30 |
*
|
31 |
+
* @param Deconf_Client $client
|
32 |
+
* @param Deconf_Http_Request $req
|
33 |
* @return array decoded result
|
34 |
+
* @throws Deconf_Service_Exception on server side error (ie: not authenticated,
|
35 |
* invalid or malformed post body, invalid url)
|
36 |
*/
|
37 |
+
public static function execute(Deconf_Client $client, Deconf_Http_Request $req)
|
38 |
{
|
39 |
+
$runner = new Deconf_Task_Runner(
|
40 |
$client,
|
41 |
sprintf('%s %s', $req->getRequestMethod(), $req->getUrl()),
|
42 |
array(get_class(), 'doExecute'),
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
+
* Executes a Deconf_Http_Request
|
51 |
*
|
52 |
+
* @param Deconf_Client $client
|
53 |
+
* @param Deconf_Http_Request $req
|
54 |
* @return array decoded result
|
55 |
+
* @throws Deconf_Service_Exception on server side error (ie: not authenticated,
|
56 |
* invalid or malformed post body, invalid url)
|
57 |
*/
|
58 |
+
public static function doExecute(Deconf_Client $client, Deconf_Http_Request $req)
|
59 |
{
|
60 |
$httpRequest = $client->getIo()->makeRequest($req);
|
61 |
$httpRequest->setExpectedClass($req->getExpectedClass());
|
65 |
/**
|
66 |
* Decode an HTTP Response.
|
67 |
* @static
|
68 |
+
* @throws Deconf_Service_Exception
|
69 |
+
* @param Deconf_Http_Request $response The http response to be decoded.
|
70 |
+
* @param Deconf_Client $client
|
71 |
* @return mixed|null
|
72 |
*/
|
73 |
+
public static function decodeHttpResponse($response, Deconf_Client $client = null)
|
74 |
{
|
75 |
$code = $response->getResponseHttpCode();
|
76 |
$body = $response->getResponseBody();
|
103 |
);
|
104 |
|
105 |
$map = $client->getClassConfig(
|
106 |
+
'Deconf_Service_Exception',
|
107 |
'retry_map'
|
108 |
);
|
109 |
}
|
110 |
+
throw new Deconf_Service_Exception($err, $code, null, $errors, $map);
|
111 |
}
|
112 |
|
113 |
// Only attempt to decode the response, if the response code wasn't (204) 'no content'
|
122 |
if ($client) {
|
123 |
$client->getLogger()->error($error);
|
124 |
}
|
125 |
+
throw new Deconf_Service_Exception($error);
|
126 |
}
|
127 |
|
128 |
if ($response->getExpectedClass()) {
|
165 |
}
|
166 |
|
167 |
if (count($uriTemplateVars)) {
|
168 |
+
$uriTemplateParser = new Deconf_Utils_URITemplate();
|
169 |
$requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars);
|
170 |
}
|
171 |
|
tools/src/{Google → Deconf}/Http/Request.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -27,7 +27,7 @@ if (!class_exists('Google_Client')) {
|
|
27 |
* @author Chirag Shah <chirags@google.com>
|
28 |
*
|
29 |
*/
|
30 |
-
class
|
31 |
{
|
32 |
const GZIP_UA = " (gzip)";
|
33 |
|
@@ -222,7 +222,7 @@ class Google_Http_Request
|
|
222 |
*/
|
223 |
public function setResponseHeaders($headers)
|
224 |
{
|
225 |
-
$headers =
|
226 |
if ($this->responseHeaders) {
|
227 |
$headers = array_merge($this->responseHeaders, $headers);
|
228 |
}
|
@@ -340,7 +340,7 @@ class Google_Http_Request
|
|
340 |
*/
|
341 |
public function setRequestHeaders($headers)
|
342 |
{
|
343 |
-
$headers =
|
344 |
if ($this->requestHeaders) {
|
345 |
$headers = array_merge($this->requestHeaders, $headers);
|
346 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
27 |
* @author Chirag Shah <chirags@google.com>
|
28 |
*
|
29 |
*/
|
30 |
+
class Deconf_Http_Request
|
31 |
{
|
32 |
const GZIP_UA = " (gzip)";
|
33 |
|
222 |
*/
|
223 |
public function setResponseHeaders($headers)
|
224 |
{
|
225 |
+
$headers = Deconf_Utils::normalize($headers);
|
226 |
if ($this->responseHeaders) {
|
227 |
$headers = array_merge($this->responseHeaders, $headers);
|
228 |
}
|
340 |
*/
|
341 |
public function setRequestHeaders($headers)
|
342 |
{
|
343 |
+
$headers = Deconf_Utils::normalize($headers);
|
344 |
if ($this->requestHeaders) {
|
345 |
$headers = array_merge($this->requestHeaders, $headers);
|
346 |
}
|
tools/src/{Google → Deconf}/IO/Abstract.php
RENAMED
@@ -19,11 +19,11 @@
|
|
19 |
* Abstract IO base class
|
20 |
*/
|
21 |
|
22 |
-
if (!class_exists('
|
23 |
require_once dirname(__FILE__) . '/../autoload.php';
|
24 |
}
|
25 |
|
26 |
-
abstract class
|
27 |
{
|
28 |
const UNKNOWN_CODE = 0;
|
29 |
const FORM_URLENCODED = 'application/x-www-form-urlencoded';
|
@@ -44,25 +44,25 @@ abstract class Google_IO_Abstract
|
|
44 |
);
|
45 |
|
46 |
|
47 |
-
/** @var
|
48 |
protected $client;
|
49 |
|
50 |
-
public function __construct(
|
51 |
{
|
52 |
$this->client = $client;
|
53 |
-
$timeout = $client->getClassConfig('
|
54 |
if ($timeout > 0) {
|
55 |
$this->setTimeout($timeout);
|
56 |
}
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
-
* Executes a
|
61 |
-
* @param
|
62 |
* @return array containing response headers, body, and http code
|
63 |
-
* @throws
|
64 |
*/
|
65 |
-
abstract public function executeRequest(
|
66 |
|
67 |
/**
|
68 |
* Set options that update the transport implementation's behavior.
|
@@ -96,14 +96,14 @@ abstract class Google_IO_Abstract
|
|
96 |
/**
|
97 |
* @visible for testing.
|
98 |
* Cache the response to an HTTP request if it is cacheable.
|
99 |
-
* @param
|
100 |
* @return bool Returns true if the insertion was successful.
|
101 |
* Otherwise, return false.
|
102 |
*/
|
103 |
-
public function setCachedRequest(
|
104 |
{
|
105 |
// Determine if the request is cacheable.
|
106 |
-
if (
|
107 |
$this->client->getCache()->set($request->getCacheKey(), $request);
|
108 |
return true;
|
109 |
}
|
@@ -114,16 +114,16 @@ abstract class Google_IO_Abstract
|
|
114 |
/**
|
115 |
* Execute an HTTP Request
|
116 |
*
|
117 |
-
* @param
|
118 |
-
* @return
|
119 |
* response headers and response body filled in
|
120 |
-
* @throws
|
121 |
*/
|
122 |
-
public function makeRequest(
|
123 |
{
|
124 |
// First, check to see if we have a valid cached version.
|
125 |
$cached = $this->getCachedRequest($request);
|
126 |
-
if ($cached !== false && $cached instanceof
|
127 |
if (!$this->checkMustRevalidateCachedRequest($cached, $request)) {
|
128 |
return $cached;
|
129 |
}
|
@@ -156,13 +156,13 @@ abstract class Google_IO_Abstract
|
|
156 |
|
157 |
/**
|
158 |
* @visible for testing.
|
159 |
-
* @param
|
160 |
-
* @return
|
161 |
* false if the operation was unsuccessful.
|
162 |
*/
|
163 |
-
public function getCachedRequest(
|
164 |
{
|
165 |
-
if (false ===
|
166 |
return false;
|
167 |
}
|
168 |
|
@@ -172,10 +172,10 @@ abstract class Google_IO_Abstract
|
|
172 |
/**
|
173 |
* @visible for testing
|
174 |
* Process an http request that contains an enclosed entity.
|
175 |
-
* @param
|
176 |
-
* @return
|
177 |
*/
|
178 |
-
public function processEntityRequest(
|
179 |
{
|
180 |
$postBody = $request->getPostBody();
|
181 |
$contentType = $request->getRequestHeader("content-type");
|
@@ -204,14 +204,14 @@ abstract class Google_IO_Abstract
|
|
204 |
/**
|
205 |
* Check if an already cached request must be revalidated, and if so update
|
206 |
* the request with the correct ETag headers.
|
207 |
-
* @param
|
208 |
-
* @param
|
209 |
* return bool If the cached object needs to be revalidated, false if it is
|
210 |
* still current and can be re-used.
|
211 |
*/
|
212 |
protected function checkMustRevalidateCachedRequest($cached, $request)
|
213 |
{
|
214 |
-
if (
|
215 |
$addHeaders = array();
|
216 |
if ($cached->getResponseHeader('etag')) {
|
217 |
// [13.3.4] If an entity tag has been provided by the origin server,
|
@@ -230,7 +230,7 @@ abstract class Google_IO_Abstract
|
|
230 |
|
231 |
/**
|
232 |
* Update a cached request, using the headers from the last response.
|
233 |
-
* @param
|
234 |
* @param mixed Associative array of response headers from the last request.
|
235 |
*/
|
236 |
protected function updateCachedRequest($cached, $responseHeaders)
|
19 |
* Abstract IO base class
|
20 |
*/
|
21 |
|
22 |
+
if (!class_exists('Deconf_Client')) {
|
23 |
require_once dirname(__FILE__) . '/../autoload.php';
|
24 |
}
|
25 |
|
26 |
+
abstract class Deconf_IO_Abstract
|
27 |
{
|
28 |
const UNKNOWN_CODE = 0;
|
29 |
const FORM_URLENCODED = 'application/x-www-form-urlencoded';
|
44 |
);
|
45 |
|
46 |
|
47 |
+
/** @var Deconf_Client */
|
48 |
protected $client;
|
49 |
|
50 |
+
public function __construct(Deconf_Client $client)
|
51 |
{
|
52 |
$this->client = $client;
|
53 |
+
$timeout = $client->getClassConfig('Deconf_IO_Abstract', 'request_timeout_seconds');
|
54 |
if ($timeout > 0) {
|
55 |
$this->setTimeout($timeout);
|
56 |
}
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
+
* Executes a Deconf_Http_Request
|
61 |
+
* @param Deconf_Http_Request $request the http request to be executed
|
62 |
* @return array containing response headers, body, and http code
|
63 |
+
* @throws Deconf_IO_Exception on curl or IO error
|
64 |
*/
|
65 |
+
abstract public function executeRequest(Deconf_Http_Request $request);
|
66 |
|
67 |
/**
|
68 |
* Set options that update the transport implementation's behavior.
|
96 |
/**
|
97 |
* @visible for testing.
|
98 |
* Cache the response to an HTTP request if it is cacheable.
|
99 |
+
* @param Deconf_Http_Request $request
|
100 |
* @return bool Returns true if the insertion was successful.
|
101 |
* Otherwise, return false.
|
102 |
*/
|
103 |
+
public function setCachedRequest(Deconf_Http_Request $request)
|
104 |
{
|
105 |
// Determine if the request is cacheable.
|
106 |
+
if (Deconf_Http_CacheParser::isResponseCacheable($request)) {
|
107 |
$this->client->getCache()->set($request->getCacheKey(), $request);
|
108 |
return true;
|
109 |
}
|
114 |
/**
|
115 |
* Execute an HTTP Request
|
116 |
*
|
117 |
+
* @param Deconf_Http_Request $request the http request to be executed
|
118 |
+
* @return Deconf_Http_Request http request with the response http code,
|
119 |
* response headers and response body filled in
|
120 |
+
* @throws Deconf_IO_Exception on curl or IO error
|
121 |
*/
|
122 |
+
public function makeRequest(Deconf_Http_Request $request)
|
123 |
{
|
124 |
// First, check to see if we have a valid cached version.
|
125 |
$cached = $this->getCachedRequest($request);
|
126 |
+
if ($cached !== false && $cached instanceof Deconf_Http_Request) {
|
127 |
if (!$this->checkMustRevalidateCachedRequest($cached, $request)) {
|
128 |
return $cached;
|
129 |
}
|
156 |
|
157 |
/**
|
158 |
* @visible for testing.
|
159 |
+
* @param Deconf_Http_Request $request
|
160 |
+
* @return Deconf_Http_Request|bool Returns the cached object or
|
161 |
* false if the operation was unsuccessful.
|
162 |
*/
|
163 |
+
public function getCachedRequest(Deconf_Http_Request $request)
|
164 |
{
|
165 |
+
if (false === Deconf_Http_CacheParser::isRequestCacheable($request)) {
|
166 |
return false;
|
167 |
}
|
168 |
|
172 |
/**
|
173 |
* @visible for testing
|
174 |
* Process an http request that contains an enclosed entity.
|
175 |
+
* @param Deconf_Http_Request $request
|
176 |
+
* @return Deconf_Http_Request Processed request with the enclosed entity.
|
177 |
*/
|
178 |
+
public function processEntityRequest(Deconf_Http_Request $request)
|
179 |
{
|
180 |
$postBody = $request->getPostBody();
|
181 |
$contentType = $request->getRequestHeader("content-type");
|
204 |
/**
|
205 |
* Check if an already cached request must be revalidated, and if so update
|
206 |
* the request with the correct ETag headers.
|
207 |
+
* @param Deconf_Http_Request $cached A previously cached response.
|
208 |
+
* @param Deconf_Http_Request $request The outbound request.
|
209 |
* return bool If the cached object needs to be revalidated, false if it is
|
210 |
* still current and can be re-used.
|
211 |
*/
|
212 |
protected function checkMustRevalidateCachedRequest($cached, $request)
|
213 |
{
|
214 |
+
if (Deconf_Http_CacheParser::mustRevalidate($cached)) {
|
215 |
$addHeaders = array();
|
216 |
if ($cached->getResponseHeader('etag')) {
|
217 |
// [13.3.4] If an entity tag has been provided by the origin server,
|
230 |
|
231 |
/**
|
232 |
* Update a cached request, using the headers from the last response.
|
233 |
+
* @param Deconf_Http_Request $cached A previously cached response.
|
234 |
* @param mixed Associative array of response headers from the last request.
|
235 |
*/
|
236 |
protected function updateCachedRequest($cached, $responseHeaders)
|
tools/src/{Google → Deconf}/IO/Curl.php
RENAMED
@@ -16,16 +16,16 @@
|
|
16 |
*/
|
17 |
|
18 |
/**
|
19 |
-
* Curl based implementation of
|
20 |
*
|
21 |
* @author Stuart Langley <slangley@google.com>
|
22 |
*/
|
23 |
|
24 |
-
if (!class_exists('
|
25 |
require_once dirname(__FILE__) . '/../autoload.php';
|
26 |
}
|
27 |
|
28 |
-
class
|
29 |
{
|
30 |
// cURL hex representation of version 7.30.0
|
31 |
const NO_QUIRK_VERSION = 0x071E00;
|
@@ -35,18 +35,18 @@ class Google_IO_Curl extends Google_IO_Abstract
|
|
35 |
/** @var bool $disableProxyWorkaround */
|
36 |
private $disableProxyWorkaround;
|
37 |
|
38 |
-
public function __construct(
|
39 |
{
|
40 |
if (!extension_loaded('curl')) {
|
41 |
$error = 'The cURL IO handler requires the cURL extension to be enabled';
|
42 |
$client->getLogger()->critical($error);
|
43 |
-
throw new
|
44 |
}
|
45 |
|
46 |
parent::__construct($client);
|
47 |
|
48 |
$this->disableProxyWorkaround = $this->client->getClassConfig(
|
49 |
-
'
|
50 |
'disable_proxy_workaround'
|
51 |
);
|
52 |
}
|
@@ -54,11 +54,11 @@ class Google_IO_Curl extends Google_IO_Abstract
|
|
54 |
/**
|
55 |
* Execute an HTTP Request
|
56 |
*
|
57 |
-
* @param
|
58 |
* @return array containing response headers, body, and http code
|
59 |
-
* @throws
|
60 |
*/
|
61 |
-
public function executeRequest(
|
62 |
{
|
63 |
$curl = curl_init();
|
64 |
|
@@ -93,7 +93,7 @@ class Google_IO_Curl extends Google_IO_Abstract
|
|
93 |
curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
|
94 |
}
|
95 |
|
96 |
-
$options = $this->client->getClassConfig('
|
97 |
if (is_array($options)) {
|
98 |
$this->setOptions($options);
|
99 |
}
|
@@ -120,10 +120,10 @@ class Google_IO_Curl extends Google_IO_Abstract
|
|
120 |
if ($response === false) {
|
121 |
$error = curl_error($curl);
|
122 |
$code = curl_errno($curl);
|
123 |
-
$map = $this->client->getClassConfig('
|
124 |
|
125 |
$this->client->getLogger()->error('cURL ' . $error);
|
126 |
-
throw new
|
127 |
}
|
128 |
$headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
|
129 |
|
@@ -189,6 +189,6 @@ class Google_IO_Curl extends Google_IO_Abstract
|
|
189 |
|
190 |
$ver = curl_version();
|
191 |
$versionNum = $ver['version_number'];
|
192 |
-
return $versionNum <
|
193 |
}
|
194 |
}
|
16 |
*/
|
17 |
|
18 |
/**
|
19 |
+
* Curl based implementation of Deconf_IO.
|
20 |
*
|
21 |
* @author Stuart Langley <slangley@google.com>
|
22 |
*/
|
23 |
|
24 |
+
if (!class_exists('Deconf_Client')) {
|
25 |
require_once dirname(__FILE__) . '/../autoload.php';
|
26 |
}
|
27 |
|
28 |
+
class Deconf_IO_Curl extends Deconf_IO_Abstract
|
29 |
{
|
30 |
// cURL hex representation of version 7.30.0
|
31 |
const NO_QUIRK_VERSION = 0x071E00;
|
35 |
/** @var bool $disableProxyWorkaround */
|
36 |
private $disableProxyWorkaround;
|
37 |
|
38 |
+
public function __construct(Deconf_Client $client)
|
39 |
{
|
40 |
if (!extension_loaded('curl')) {
|
41 |
$error = 'The cURL IO handler requires the cURL extension to be enabled';
|
42 |
$client->getLogger()->critical($error);
|
43 |
+
throw new Deconf_IO_Exception($error);
|
44 |
}
|
45 |
|
46 |
parent::__construct($client);
|
47 |
|
48 |
$this->disableProxyWorkaround = $this->client->getClassConfig(
|
49 |
+
'Deconf_IO_Curl',
|
50 |
'disable_proxy_workaround'
|
51 |
);
|
52 |
}
|
54 |
/**
|
55 |
* Execute an HTTP Request
|
56 |
*
|
57 |
+
* @param Deconf_Http_Request $request the http request to be executed
|
58 |
* @return array containing response headers, body, and http code
|
59 |
+
* @throws Deconf_IO_Exception on curl or IO error
|
60 |
*/
|
61 |
+
public function executeRequest(Deconf_Http_Request $request)
|
62 |
{
|
63 |
$curl = curl_init();
|
64 |
|
93 |
curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
|
94 |
}
|
95 |
|
96 |
+
$options = $this->client->getClassConfig('Deconf_IO_Curl', 'options');
|
97 |
if (is_array($options)) {
|
98 |
$this->setOptions($options);
|
99 |
}
|
120 |
if ($response === false) {
|
121 |
$error = curl_error($curl);
|
122 |
$code = curl_errno($curl);
|
123 |
+
$map = $this->client->getClassConfig('Deconf_IO_Exception', 'retry_map');
|
124 |
|
125 |
$this->client->getLogger()->error('cURL ' . $error);
|
126 |
+
throw new Deconf_IO_Exception($error, $code, null, $map);
|
127 |
}
|
128 |
$headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
|
129 |
|
189 |
|
190 |
$ver = curl_version();
|
191 |
$versionNum = $ver['version_number'];
|
192 |
+
return $versionNum < Deconf_IO_Curl::NO_QUIRK_VERSION;
|
193 |
}
|
194 |
}
|
tools/src/{Google → Deconf}/IO/Exception.php
RENAMED
@@ -15,11 +15,11 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
/**
|
25 |
* @var array $retryMap Map of errors with retry counts.
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
+
class Deconf_IO_Exception extends Deconf_Exception implements Deconf_Task_Retryable
|
23 |
{
|
24 |
/**
|
25 |
* @var array $retryMap Map of errors with retry counts.
|
tools/src/{Google → Deconf}/IO/Stream.php
RENAMED
@@ -16,16 +16,16 @@
|
|
16 |
*/
|
17 |
|
18 |
/**
|
19 |
-
* Http Streams based implementation of
|
20 |
*
|
21 |
* @author Stuart Langley <slangley@google.com>
|
22 |
*/
|
23 |
|
24 |
-
if (!class_exists('
|
25 |
require_once dirname(__FILE__) . '/../autoload.php';
|
26 |
}
|
27 |
|
28 |
-
class
|
29 |
{
|
30 |
const TIMEOUT = "timeout";
|
31 |
const ZLIB = "compress.zlib://";
|
@@ -42,13 +42,13 @@ class Google_IO_Stream extends Google_IO_Abstract
|
|
42 |
"verify_peer" => true,
|
43 |
);
|
44 |
|
45 |
-
public function __construct(
|
46 |
{
|
47 |
if (!ini_get('allow_url_fopen')) {
|
48 |
$error = 'The stream IO handler requires the allow_url_fopen runtime ' .
|
49 |
'configuration to be enabled';
|
50 |
$client->getLogger()->critical($error);
|
51 |
-
throw new
|
52 |
}
|
53 |
|
54 |
parent::__construct($client);
|
@@ -57,11 +57,11 @@ class Google_IO_Stream extends Google_IO_Abstract
|
|
57 |
/**
|
58 |
* Execute an HTTP Request
|
59 |
*
|
60 |
-
* @param
|
61 |
* @return array containing response headers, body, and http code
|
62 |
-
* @throws
|
63 |
*/
|
64 |
-
public function executeRequest(
|
65 |
{
|
66 |
$default_options = stream_context_get_options(stream_context_get_default());
|
67 |
|
@@ -138,7 +138,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
|
138 |
);
|
139 |
|
140 |
$this->client->getLogger()->error('Stream ' . $error);
|
141 |
-
throw new
|
142 |
}
|
143 |
|
144 |
$response_data = false;
|
@@ -161,7 +161,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
|
161 |
);
|
162 |
|
163 |
$this->client->getLogger()->error('Stream ' . $error);
|
164 |
-
throw new
|
165 |
}
|
166 |
|
167 |
$responseHeaders = $this->getHttpResponseHeaders($http_response_header);
|
16 |
*/
|
17 |
|
18 |
/**
|
19 |
+
* Http Streams based implementation of Deconf_IO.
|
20 |
*
|
21 |
* @author Stuart Langley <slangley@google.com>
|
22 |
*/
|
23 |
|
24 |
+
if (!class_exists('Deconf_Client')) {
|
25 |
require_once dirname(__FILE__) . '/../autoload.php';
|
26 |
}
|
27 |
|
28 |
+
class Deconf_IO_Stream extends Deconf_IO_Abstract
|
29 |
{
|
30 |
const TIMEOUT = "timeout";
|
31 |
const ZLIB = "compress.zlib://";
|
42 |
"verify_peer" => true,
|
43 |
);
|
44 |
|
45 |
+
public function __construct(Deconf_Client $client)
|
46 |
{
|
47 |
if (!ini_get('allow_url_fopen')) {
|
48 |
$error = 'The stream IO handler requires the allow_url_fopen runtime ' .
|
49 |
'configuration to be enabled';
|
50 |
$client->getLogger()->critical($error);
|
51 |
+
throw new Deconf_IO_Exception($error);
|
52 |
}
|
53 |
|
54 |
parent::__construct($client);
|
57 |
/**
|
58 |
* Execute an HTTP Request
|
59 |
*
|
60 |
+
* @param Deconf_Http_Request $request the http request to be executed
|
61 |
* @return array containing response headers, body, and http code
|
62 |
+
* @throws Deconf_IO_Exception on curl or IO error
|
63 |
*/
|
64 |
+
public function executeRequest(Deconf_Http_Request $request)
|
65 |
{
|
66 |
$default_options = stream_context_get_options(stream_context_get_default());
|
67 |
|
138 |
);
|
139 |
|
140 |
$this->client->getLogger()->error('Stream ' . $error);
|
141 |
+
throw new Deconf_IO_Exception($error, $this->trappedErrorNumber);
|
142 |
}
|
143 |
|
144 |
$response_data = false;
|
161 |
);
|
162 |
|
163 |
$this->client->getLogger()->error('Stream ' . $error);
|
164 |
+
throw new Deconf_IO_Exception($error, $respHttpCode);
|
165 |
}
|
166 |
|
167 |
$responseHeaders = $this->getHttpResponseHeaders($http_response_header);
|
tools/src/{Google → Deconf}/IO/cacerts.pem
RENAMED
File without changes
|
tools/src/{Google → Deconf}/Logger/Abstract.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -27,7 +27,7 @@ if (!class_exists('Google_Client')) {
|
|
27 |
*
|
28 |
* @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
|
29 |
*/
|
30 |
-
abstract class
|
31 |
{
|
32 |
/**
|
33 |
* Default log format
|
@@ -118,22 +118,22 @@ abstract class Google_Logger_Abstract
|
|
118 |
protected $allowNewLines = false;
|
119 |
|
120 |
/**
|
121 |
-
* @param
|
122 |
*/
|
123 |
-
public function __construct(
|
124 |
{
|
125 |
$this->setLevel(
|
126 |
-
$client->getClassConfig('
|
127 |
);
|
128 |
|
129 |
-
$format = $client->getClassConfig('
|
130 |
$this->logFormat = $format ? $format : self::DEFAULT_LOG_FORMAT;
|
131 |
|
132 |
-
$format = $client->getClassConfig('
|
133 |
$this->dateFormat = $format ? $format : self::DEFAULT_DATE_FORMAT;
|
134 |
|
135 |
$this->allowNewLines = (bool) $client->getClassConfig(
|
136 |
-
'
|
137 |
'allow_newlines'
|
138 |
);
|
139 |
}
|
@@ -382,7 +382,7 @@ abstract class Google_Logger_Abstract
|
|
382 |
*
|
383 |
* @param mixed $level The logging level
|
384 |
* @return integer $level The normalized level
|
385 |
-
* @throws
|
386 |
*/
|
387 |
protected function normalizeLevel($level)
|
388 |
{
|
@@ -394,7 +394,7 @@ abstract class Google_Logger_Abstract
|
|
394 |
return self::$levels[$level];
|
395 |
}
|
396 |
|
397 |
-
throw new
|
398 |
sprintf("Unknown LogLevel: '%s'", $level)
|
399 |
);
|
400 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
27 |
*
|
28 |
* @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
|
29 |
*/
|
30 |
+
abstract class Deconf_Logger_Abstract
|
31 |
{
|
32 |
/**
|
33 |
* Default log format
|
118 |
protected $allowNewLines = false;
|
119 |
|
120 |
/**
|
121 |
+
* @param Deconf_Client $client The current Google client
|
122 |
*/
|
123 |
+
public function __construct(Deconf_Client $client)
|
124 |
{
|
125 |
$this->setLevel(
|
126 |
+
$client->getClassConfig('Deconf_Logger_Abstract', 'level')
|
127 |
);
|
128 |
|
129 |
+
$format = $client->getClassConfig('Deconf_Logger_Abstract', 'log_format');
|
130 |
$this->logFormat = $format ? $format : self::DEFAULT_LOG_FORMAT;
|
131 |
|
132 |
+
$format = $client->getClassConfig('Deconf_Logger_Abstract', 'date_format');
|
133 |
$this->dateFormat = $format ? $format : self::DEFAULT_DATE_FORMAT;
|
134 |
|
135 |
$this->allowNewLines = (bool) $client->getClassConfig(
|
136 |
+
'Deconf_Logger_Abstract',
|
137 |
'allow_newlines'
|
138 |
);
|
139 |
}
|
382 |
*
|
383 |
* @param mixed $level The logging level
|
384 |
* @return integer $level The normalized level
|
385 |
+
* @throws Deconf_Logger_Exception If $level is invalid
|
386 |
*/
|
387 |
protected function normalizeLevel($level)
|
388 |
{
|
394 |
return self::$levels[$level];
|
395 |
}
|
396 |
|
397 |
+
throw new Deconf_Logger_Exception(
|
398 |
sprintf("Unknown LogLevel: '%s'", $level)
|
399 |
);
|
400 |
}
|
tools/src/{Google → Deconf}/Logger/Exception.php
RENAMED
@@ -15,10 +15,10 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
+
class Deconf_Logger_Exception extends Deconf_Exception
|
23 |
{
|
24 |
}
|
tools/src/{Google → Deconf}/Logger/File.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,7 +24,7 @@ if (!class_exists('Google_Client')) {
|
|
24 |
*
|
25 |
* This logger writes to a PHP stream resource.
|
26 |
*/
|
27 |
-
class
|
28 |
{
|
29 |
/**
|
30 |
* @var string|resource $file Where logs are written
|
@@ -51,23 +51,23 @@ class Google_Logger_File extends Google_Logger_Abstract
|
|
51 |
/**
|
52 |
* {@inheritdoc}
|
53 |
*/
|
54 |
-
public function __construct(
|
55 |
{
|
56 |
parent::__construct($client);
|
57 |
|
58 |
-
$file = $client->getClassConfig('
|
59 |
if (!is_string($file) && !is_resource($file)) {
|
60 |
-
throw new
|
61 |
'File logger requires a filename or a valid file pointer'
|
62 |
);
|
63 |
}
|
64 |
|
65 |
-
$mode = $client->getClassConfig('
|
66 |
if (!$mode) {
|
67 |
$this->mode = $mode;
|
68 |
}
|
69 |
|
70 |
-
$this->lock = (bool) $client->getClassConfig('
|
71 |
$this->file = $file;
|
72 |
}
|
73 |
|
@@ -79,7 +79,7 @@ class Google_Logger_File extends Google_Logger_Abstract
|
|
79 |
if (is_string($this->file)) {
|
80 |
$this->open();
|
81 |
} elseif (!is_resource($this->file)) {
|
82 |
-
throw new
|
83 |
}
|
84 |
|
85 |
if ($this->lock) {
|
@@ -113,7 +113,7 @@ class Google_Logger_File extends Google_Logger_Abstract
|
|
113 |
|
114 |
// Handles trapped `fopen()` errors.
|
115 |
if ($this->trappedErrorNumber) {
|
116 |
-
throw new
|
117 |
sprintf(
|
118 |
"Logger Error: '%s'",
|
119 |
$this->trappedErrorString
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
*
|
25 |
* This logger writes to a PHP stream resource.
|
26 |
*/
|
27 |
+
class Deconf_Logger_File extends Deconf_Logger_Abstract
|
28 |
{
|
29 |
/**
|
30 |
* @var string|resource $file Where logs are written
|
51 |
/**
|
52 |
* {@inheritdoc}
|
53 |
*/
|
54 |
+
public function __construct(Deconf_Client $client)
|
55 |
{
|
56 |
parent::__construct($client);
|
57 |
|
58 |
+
$file = $client->getClassConfig('Deconf_Logger_File', 'file');
|
59 |
if (!is_string($file) && !is_resource($file)) {
|
60 |
+
throw new Deconf_Logger_Exception(
|
61 |
'File logger requires a filename or a valid file pointer'
|
62 |
);
|
63 |
}
|
64 |
|
65 |
+
$mode = $client->getClassConfig('Deconf_Logger_File', 'mode');
|
66 |
if (!$mode) {
|
67 |
$this->mode = $mode;
|
68 |
}
|
69 |
|
70 |
+
$this->lock = (bool) $client->getClassConfig('Deconf_Logger_File', 'lock');
|
71 |
$this->file = $file;
|
72 |
}
|
73 |
|
79 |
if (is_string($this->file)) {
|
80 |
$this->open();
|
81 |
} elseif (!is_resource($this->file)) {
|
82 |
+
throw new Deconf_Logger_Exception('File pointer is no longer available');
|
83 |
}
|
84 |
|
85 |
if ($this->lock) {
|
113 |
|
114 |
// Handles trapped `fopen()` errors.
|
115 |
if ($this->trappedErrorNumber) {
|
116 |
+
throw new Deconf_Logger_Exception(
|
117 |
sprintf(
|
118 |
"Logger Error: '%s'",
|
119 |
$this->trappedErrorString
|
tools/src/{Google → Deconf}/Logger/Null.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,7 +24,7 @@ if (!class_exists('Google_Client')) {
|
|
24 |
*
|
25 |
* This logger simply discards all messages.
|
26 |
*/
|
27 |
-
class
|
28 |
{
|
29 |
/**
|
30 |
* {@inheritdoc}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
*
|
25 |
* This logger simply discards all messages.
|
26 |
*/
|
27 |
+
class Deconf_Logger_Null extends Deconf_Logger_Abstract
|
28 |
{
|
29 |
/**
|
30 |
* {@inheritdoc}
|
tools/src/{Google → Deconf}/Logger/Psr.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -23,9 +23,9 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* Psr logging class based on the PSR-3 standard.
|
24 |
*
|
25 |
* This logger will delegate all logging to a PSR-3 compatible logger specified
|
26 |
-
* with the `
|
27 |
*/
|
28 |
-
class
|
29 |
{
|
30 |
/**
|
31 |
* @param Psr\Log\LoggerInterface $logger The PSR-3 logger
|
@@ -33,10 +33,10 @@ class Google_Logger_Psr extends Google_Logger_Abstract
|
|
33 |
private $logger;
|
34 |
|
35 |
/**
|
36 |
-
* @param
|
37 |
* @param Psr\Log\LoggerInterface $logger PSR-3 logger where logging will be delegated.
|
38 |
*/
|
39 |
-
public function __construct(
|
40 |
{
|
41 |
parent::__construct($client);
|
42 |
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
23 |
* Psr logging class based on the PSR-3 standard.
|
24 |
*
|
25 |
* This logger will delegate all logging to a PSR-3 compatible logger specified
|
26 |
+
* with the `Deconf_Logger_Psr::setLogger()` method.
|
27 |
*/
|
28 |
+
class Deconf_Logger_Psr extends Deconf_Logger_Abstract
|
29 |
{
|
30 |
/**
|
31 |
* @param Psr\Log\LoggerInterface $logger The PSR-3 logger
|
33 |
private $logger;
|
34 |
|
35 |
/**
|
36 |
+
* @param Deconf_Client $client The current Google client
|
37 |
* @param Psr\Log\LoggerInterface $logger PSR-3 logger where logging will be delegated.
|
38 |
*/
|
39 |
+
public function __construct(Deconf_Client $client, /*Psr\Log\LoggerInterface*/ $logger = null)
|
40 |
{
|
41 |
parent::__construct($client);
|
42 |
|
tools/src/{Google → Deconf}/Model.php
RENAMED
@@ -21,10 +21,10 @@
|
|
21 |
* http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5
|
22 |
*
|
23 |
*/
|
24 |
-
class
|
25 |
{
|
26 |
/**
|
27 |
-
* If you need to specify a NULL JSON value, use
|
28 |
* instead - it will be replaced when converting to JSON with a real null.
|
29 |
*/
|
30 |
const NULL_VALUE = "{}gapi-php-null";
|
@@ -102,7 +102,7 @@ class Google_Model implements ArrayAccess
|
|
102 |
property_exists($this, $key)) {
|
103 |
$this->$key = $val;
|
104 |
unset($array[$key]);
|
105 |
-
} elseif (property_exists($this, $camelKey =
|
106 |
// This checks if property exists as camelCase, leaving it in array as snake_case
|
107 |
// in case of backwards compatibility issues.
|
108 |
$this->$camelKey = $val;
|
@@ -160,7 +160,7 @@ class Google_Model implements ArrayAccess
|
|
160 |
*/
|
161 |
private function getSimpleValue($value)
|
162 |
{
|
163 |
-
if ($value instanceof
|
164 |
return $value->toSimpleObject();
|
165 |
} else if (is_array($value)) {
|
166 |
$return = array();
|
@@ -233,14 +233,14 @@ class Google_Model implements ArrayAccess
|
|
233 |
|
234 |
/**
|
235 |
* Verify if $obj is an array.
|
236 |
-
* @throws
|
237 |
* @param array $obj Items that should be validated.
|
238 |
* @param string $method Method expecting an array as an argument.
|
239 |
*/
|
240 |
public function assertIsArray($obj, $method)
|
241 |
{
|
242 |
if ($obj && !is_array($obj)) {
|
243 |
-
throw new
|
244 |
"Incorrect parameter type passed to $method(). Expected an array."
|
245 |
);
|
246 |
}
|
21 |
* http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5
|
22 |
*
|
23 |
*/
|
24 |
+
class Deconf_Model implements ArrayAccess
|
25 |
{
|
26 |
/**
|
27 |
+
* If you need to specify a NULL JSON value, use Deconf_Model::NULL_VALUE
|
28 |
* instead - it will be replaced when converting to JSON with a real null.
|
29 |
*/
|
30 |
const NULL_VALUE = "{}gapi-php-null";
|
102 |
property_exists($this, $key)) {
|
103 |
$this->$key = $val;
|
104 |
unset($array[$key]);
|
105 |
+
} elseif (property_exists($this, $camelKey = Deconf_Utils::camelCase($key))) {
|
106 |
// This checks if property exists as camelCase, leaving it in array as snake_case
|
107 |
// in case of backwards compatibility issues.
|
108 |
$this->$camelKey = $val;
|
160 |
*/
|
161 |
private function getSimpleValue($value)
|
162 |
{
|
163 |
+
if ($value instanceof Deconf_Model) {
|
164 |
return $value->toSimpleObject();
|
165 |
} else if (is_array($value)) {
|
166 |
$return = array();
|
233 |
|
234 |
/**
|
235 |
* Verify if $obj is an array.
|
236 |
+
* @throws Deconf_Exception Thrown if $obj isn't an array.
|
237 |
* @param array $obj Items that should be validated.
|
238 |
* @param string $method Method expecting an array as an argument.
|
239 |
*/
|
240 |
public function assertIsArray($obj, $method)
|
241 |
{
|
242 |
if ($obj && !is_array($obj)) {
|
243 |
+
throw new Deconf_Exception(
|
244 |
"Incorrect parameter type passed to $method(). Expected an array."
|
245 |
);
|
246 |
}
|
tools/src/{Google → Deconf}/Service.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
public $batchPath;
|
21 |
public $rootUrl;
|
@@ -25,14 +25,14 @@ class Google_Service
|
|
25 |
public $resource;
|
26 |
private $client;
|
27 |
|
28 |
-
public function __construct(
|
29 |
{
|
30 |
$this->client = $client;
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
-
* Return the associated
|
35 |
-
* @return
|
36 |
*/
|
37 |
public function getClient()
|
38 |
{
|
@@ -42,11 +42,11 @@ class Google_Service
|
|
42 |
/**
|
43 |
* Create a new HTTP Batch handler for this service
|
44 |
*
|
45 |
-
* @return
|
46 |
*/
|
47 |
public function createBatch()
|
48 |
{
|
49 |
-
return new
|
50 |
$this->client,
|
51 |
false,
|
52 |
$this->rootUrl,
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
class Deconf_Service
|
19 |
{
|
20 |
public $batchPath;
|
21 |
public $rootUrl;
|
25 |
public $resource;
|
26 |
private $client;
|
27 |
|
28 |
+
public function __construct(Deconf_Client $client)
|
29 |
{
|
30 |
$this->client = $client;
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
+
* Return the associated Deconf_Client class.
|
35 |
+
* @return Deconf_Client
|
36 |
*/
|
37 |
public function getClient()
|
38 |
{
|
42 |
/**
|
43 |
* Create a new HTTP Batch handler for this service
|
44 |
*
|
45 |
+
* @return Deconf_Http_Batch
|
46 |
*/
|
47 |
public function createBatch()
|
48 |
{
|
49 |
+
return new Deconf_Http_Batch(
|
50 |
$this->client,
|
51 |
false,
|
52 |
$this->rootUrl,
|
tools/src/{Google → Deconf}/Service/Analytics.php
RENAMED
@@ -26,7 +26,7 @@
|
|
26 |
*
|
27 |
* @author Google, Inc.
|
28 |
*/
|
29 |
-
class
|
30 |
{
|
31 |
/** View and manage your Google Analytics data. */
|
32 |
const ANALYTICS =
|
@@ -75,9 +75,9 @@ class Google_Service_Analytics extends Google_Service
|
|
75 |
/**
|
76 |
* Constructs the internal representation of the Analytics service.
|
77 |
*
|
78 |
-
* @param
|
79 |
*/
|
80 |
-
public function __construct(
|
81 |
{
|
82 |
parent::__construct($client);
|
83 |
$this->rootUrl = 'https://www.googleapis.com/';
|
@@ -85,7 +85,7 @@ class Google_Service_Analytics extends Google_Service
|
|
85 |
$this->version = 'v3';
|
86 |
$this->serviceName = 'analytics';
|
87 |
|
88 |
-
$this->data_ga = new
|
89 |
$this,
|
90 |
$this->serviceName,
|
91 |
'ga',
|
@@ -156,7 +156,7 @@ class Google_Service_Analytics extends Google_Service
|
|
156 |
)
|
157 |
)
|
158 |
);
|
159 |
-
$this->data_mcf = new
|
160 |
$this,
|
161 |
$this->serviceName,
|
162 |
'mcf',
|
@@ -215,7 +215,7 @@ class Google_Service_Analytics extends Google_Service
|
|
215 |
)
|
216 |
)
|
217 |
);
|
218 |
-
$this->data_realtime = new
|
219 |
$this,
|
220 |
$this->serviceName,
|
221 |
'realtime',
|
@@ -256,7 +256,7 @@ class Google_Service_Analytics extends Google_Service
|
|
256 |
)
|
257 |
)
|
258 |
);
|
259 |
-
$this->management_accountSummaries = new
|
260 |
$this,
|
261 |
$this->serviceName,
|
262 |
'accountSummaries',
|
@@ -279,7 +279,7 @@ class Google_Service_Analytics extends Google_Service
|
|
279 |
)
|
280 |
)
|
281 |
);
|
282 |
-
$this->management_accountUserLinks = new
|
283 |
$this,
|
284 |
$this->serviceName,
|
285 |
'accountUserLinks',
|
@@ -347,7 +347,7 @@ class Google_Service_Analytics extends Google_Service
|
|
347 |
)
|
348 |
)
|
349 |
);
|
350 |
-
$this->management_accounts = new
|
351 |
$this,
|
352 |
$this->serviceName,
|
353 |
'accounts',
|
@@ -370,7 +370,7 @@ class Google_Service_Analytics extends Google_Service
|
|
370 |
)
|
371 |
)
|
372 |
);
|
373 |
-
$this->management_customDataSources = new
|
374 |
$this,
|
375 |
$this->serviceName,
|
376 |
'customDataSources',
|
@@ -403,7 +403,7 @@ class Google_Service_Analytics extends Google_Service
|
|
403 |
)
|
404 |
)
|
405 |
);
|
406 |
-
$this->management_customDimensions = new
|
407 |
$this,
|
408 |
$this->serviceName,
|
409 |
'customDimensions',
|
@@ -519,7 +519,7 @@ class Google_Service_Analytics extends Google_Service
|
|
519 |
)
|
520 |
)
|
521 |
);
|
522 |
-
$this->management_customMetrics = new
|
523 |
$this,
|
524 |
$this->serviceName,
|
525 |
'customMetrics',
|
@@ -635,7 +635,7 @@ class Google_Service_Analytics extends Google_Service
|
|
635 |
)
|
636 |
)
|
637 |
);
|
638 |
-
$this->management_experiments = new
|
639 |
$this,
|
640 |
$this->serviceName,
|
641 |
'experiments',
|
@@ -793,7 +793,7 @@ class Google_Service_Analytics extends Google_Service
|
|
793 |
)
|
794 |
)
|
795 |
);
|
796 |
-
$this->management_filters = new
|
797 |
$this,
|
798 |
$this->serviceName,
|
799 |
'filters',
|
@@ -891,7 +891,7 @@ class Google_Service_Analytics extends Google_Service
|
|
891 |
)
|
892 |
)
|
893 |
);
|
894 |
-
$this->management_goals = new
|
895 |
$this,
|
896 |
$this->serviceName,
|
897 |
'goals',
|
@@ -1024,7 +1024,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1024 |
)
|
1025 |
)
|
1026 |
);
|
1027 |
-
$this->management_profileFilterLinks = new
|
1028 |
$this,
|
1029 |
$this->serviceName,
|
1030 |
'profileFilterLinks',
|
@@ -1182,7 +1182,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1182 |
)
|
1183 |
)
|
1184 |
);
|
1185 |
-
$this->management_profileUserLinks = new
|
1186 |
$this,
|
1187 |
$this->serviceName,
|
1188 |
'profileUserLinks',
|
@@ -1290,7 +1290,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1290 |
)
|
1291 |
)
|
1292 |
);
|
1293 |
-
$this->management_profiles = new
|
1294 |
$this,
|
1295 |
$this->serviceName,
|
1296 |
'profiles',
|
@@ -1418,7 +1418,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1418 |
)
|
1419 |
)
|
1420 |
);
|
1421 |
-
$this->management_segments = new
|
1422 |
$this,
|
1423 |
$this->serviceName,
|
1424 |
'segments',
|
@@ -1441,7 +1441,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1441 |
)
|
1442 |
)
|
1443 |
);
|
1444 |
-
$this->management_unsampledReports = new
|
1445 |
$this,
|
1446 |
$this->serviceName,
|
1447 |
'unsampledReports',
|
@@ -1549,7 +1549,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1549 |
)
|
1550 |
)
|
1551 |
);
|
1552 |
-
$this->management_uploads = new
|
1553 |
$this,
|
1554 |
$this->serviceName,
|
1555 |
'uploads',
|
@@ -1652,7 +1652,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1652 |
)
|
1653 |
)
|
1654 |
);
|
1655 |
-
$this->management_webPropertyAdWordsLinks = new
|
1656 |
$this,
|
1657 |
$this->serviceName,
|
1658 |
'webPropertyAdWordsLinks',
|
@@ -1780,7 +1780,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1780 |
)
|
1781 |
)
|
1782 |
);
|
1783 |
-
$this->management_webproperties = new
|
1784 |
$this,
|
1785 |
$this->serviceName,
|
1786 |
'webproperties',
|
@@ -1863,7 +1863,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1863 |
)
|
1864 |
)
|
1865 |
);
|
1866 |
-
$this->management_webpropertyUserLinks = new
|
1867 |
$this,
|
1868 |
$this->serviceName,
|
1869 |
'webpropertyUserLinks',
|
@@ -1951,7 +1951,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1951 |
)
|
1952 |
)
|
1953 |
);
|
1954 |
-
$this->metadata_columns = new
|
1955 |
$this,
|
1956 |
$this->serviceName,
|
1957 |
'columns',
|
@@ -1971,7 +1971,7 @@ class Google_Service_Analytics extends Google_Service
|
|
1971 |
)
|
1972 |
)
|
1973 |
);
|
1974 |
-
$this->provisioning = new
|
1975 |
$this,
|
1976 |
$this->serviceName,
|
1977 |
'provisioning',
|
@@ -1993,11 +1993,11 @@ class Google_Service_Analytics extends Google_Service
|
|
1993 |
* The "data" collection of methods.
|
1994 |
* Typical usage is:
|
1995 |
* <code>
|
1996 |
-
* $analyticsService = new
|
1997 |
* $data = $analyticsService->data;
|
1998 |
* </code>
|
1999 |
*/
|
2000 |
-
class
|
2001 |
{
|
2002 |
}
|
2003 |
|
@@ -2005,11 +2005,11 @@ class Google_Service_Analytics_Data_Resource extends Google_Service_Resource
|
|
2005 |
* The "ga" collection of methods.
|
2006 |
* Typical usage is:
|
2007 |
* <code>
|
2008 |
-
* $analyticsService = new
|
2009 |
* $ga = $analyticsService->ga;
|
2010 |
* </code>
|
2011 |
*/
|
2012 |
-
class
|
2013 |
{
|
2014 |
|
2015 |
/**
|
@@ -2043,24 +2043,24 @@ class Google_Service_Analytics_DataGa_Resource extends Google_Service_Resource
|
|
2043 |
* determine the sort order for Analytics data.
|
2044 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2045 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2046 |
-
* @return
|
2047 |
*/
|
2048 |
public function get($ids, $startDate, $endDate, $metrics, $optParams = array())
|
2049 |
{
|
2050 |
$params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics);
|
2051 |
$params = array_merge($params, $optParams);
|
2052 |
-
return $this->call('get', array($params), "
|
2053 |
}
|
2054 |
}
|
2055 |
/**
|
2056 |
* The "mcf" collection of methods.
|
2057 |
* Typical usage is:
|
2058 |
* <code>
|
2059 |
-
* $analyticsService = new
|
2060 |
* $mcf = $analyticsService->mcf;
|
2061 |
* </code>
|
2062 |
*/
|
2063 |
-
class
|
2064 |
{
|
2065 |
|
2066 |
/**
|
@@ -2090,24 +2090,24 @@ class Google_Service_Analytics_DataMcf_Resource extends Google_Service_Resource
|
|
2090 |
* determine the sort order for the Analytics data.
|
2091 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2092 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2093 |
-
* @return
|
2094 |
*/
|
2095 |
public function get($ids, $startDate, $endDate, $metrics, $optParams = array())
|
2096 |
{
|
2097 |
$params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics);
|
2098 |
$params = array_merge($params, $optParams);
|
2099 |
-
return $this->call('get', array($params), "
|
2100 |
}
|
2101 |
}
|
2102 |
/**
|
2103 |
* The "realtime" collection of methods.
|
2104 |
* Typical usage is:
|
2105 |
* <code>
|
2106 |
-
* $analyticsService = new
|
2107 |
* $realtime = $analyticsService->realtime;
|
2108 |
* </code>
|
2109 |
*/
|
2110 |
-
class
|
2111 |
{
|
2112 |
|
2113 |
/**
|
@@ -2127,13 +2127,13 @@ class Google_Service_Analytics_DataRealtime_Resource extends Google_Service_Reso
|
|
2127 |
* feed.
|
2128 |
* @opt_param string sort A comma-separated list of dimensions or metrics that
|
2129 |
* determine the sort order for real time data.
|
2130 |
-
* @return
|
2131 |
*/
|
2132 |
public function get($ids, $metrics, $optParams = array())
|
2133 |
{
|
2134 |
$params = array('ids' => $ids, 'metrics' => $metrics);
|
2135 |
$params = array_merge($params, $optParams);
|
2136 |
-
return $this->call('get', array($params), "
|
2137 |
}
|
2138 |
}
|
2139 |
|
@@ -2141,11 +2141,11 @@ class Google_Service_Analytics_DataRealtime_Resource extends Google_Service_Reso
|
|
2141 |
* The "management" collection of methods.
|
2142 |
* Typical usage is:
|
2143 |
* <code>
|
2144 |
-
* $analyticsService = new
|
2145 |
* $management = $analyticsService->management;
|
2146 |
* </code>
|
2147 |
*/
|
2148 |
-
class
|
2149 |
{
|
2150 |
}
|
2151 |
|
@@ -2153,11 +2153,11 @@ class Google_Service_Analytics_Management_Resource extends Google_Service_Resour
|
|
2153 |
* The "accountSummaries" collection of methods.
|
2154 |
* Typical usage is:
|
2155 |
* <code>
|
2156 |
-
* $analyticsService = new
|
2157 |
* $accountSummaries = $analyticsService->accountSummaries;
|
2158 |
* </code>
|
2159 |
*/
|
2160 |
-
class
|
2161 |
{
|
2162 |
|
2163 |
/**
|
@@ -2171,24 +2171,24 @@ class Google_Service_Analytics_ManagementAccountSummaries_Resource extends Googl
|
|
2171 |
* in this response, where the largest acceptable value is 1000.
|
2172 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2173 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2174 |
-
* @return
|
2175 |
*/
|
2176 |
public function listManagementAccountSummaries($optParams = array())
|
2177 |
{
|
2178 |
$params = array();
|
2179 |
$params = array_merge($params, $optParams);
|
2180 |
-
return $this->call('list', array($params), "
|
2181 |
}
|
2182 |
}
|
2183 |
/**
|
2184 |
* The "accountUserLinks" collection of methods.
|
2185 |
* Typical usage is:
|
2186 |
* <code>
|
2187 |
-
* $analyticsService = new
|
2188 |
* $accountUserLinks = $analyticsService->accountUserLinks;
|
2189 |
* </code>
|
2190 |
*/
|
2191 |
-
class
|
2192 |
{
|
2193 |
|
2194 |
/**
|
@@ -2209,15 +2209,15 @@ class Google_Service_Analytics_ManagementAccountUserLinks_Resource extends Googl
|
|
2209 |
* Adds a new user to the given account. (accountUserLinks.insert)
|
2210 |
*
|
2211 |
* @param string $accountId Account ID to create the user link for.
|
2212 |
-
* @param
|
2213 |
* @param array $optParams Optional parameters.
|
2214 |
-
* @return
|
2215 |
*/
|
2216 |
-
public function insert($accountId,
|
2217 |
{
|
2218 |
$params = array('accountId' => $accountId, 'postBody' => $postBody);
|
2219 |
$params = array_merge($params, $optParams);
|
2220 |
-
return $this->call('insert', array($params), "
|
2221 |
}
|
2222 |
|
2223 |
/**
|
@@ -2232,13 +2232,13 @@ class Google_Service_Analytics_ManagementAccountUserLinks_Resource extends Googl
|
|
2232 |
* @opt_param int start-index An index of the first account-user link to
|
2233 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
2234 |
* results parameter.
|
2235 |
-
* @return
|
2236 |
*/
|
2237 |
public function listManagementAccountUserLinks($accountId, $optParams = array())
|
2238 |
{
|
2239 |
$params = array('accountId' => $accountId);
|
2240 |
$params = array_merge($params, $optParams);
|
2241 |
-
return $this->call('list', array($params), "
|
2242 |
}
|
2243 |
|
2244 |
/**
|
@@ -2247,26 +2247,26 @@ class Google_Service_Analytics_ManagementAccountUserLinks_Resource extends Googl
|
|
2247 |
*
|
2248 |
* @param string $accountId Account ID to update the account-user link for.
|
2249 |
* @param string $linkId Link ID to update the account-user link for.
|
2250 |
-
* @param
|
2251 |
* @param array $optParams Optional parameters.
|
2252 |
-
* @return
|
2253 |
*/
|
2254 |
-
public function update($accountId, $linkId,
|
2255 |
{
|
2256 |
$params = array('accountId' => $accountId, 'linkId' => $linkId, 'postBody' => $postBody);
|
2257 |
$params = array_merge($params, $optParams);
|
2258 |
-
return $this->call('update', array($params), "
|
2259 |
}
|
2260 |
}
|
2261 |
/**
|
2262 |
* The "accounts" collection of methods.
|
2263 |
* Typical usage is:
|
2264 |
* <code>
|
2265 |
-
* $analyticsService = new
|
2266 |
* $accounts = $analyticsService->accounts;
|
2267 |
* </code>
|
2268 |
*/
|
2269 |
-
class
|
2270 |
{
|
2271 |
|
2272 |
/**
|
@@ -2280,24 +2280,24 @@ class Google_Service_Analytics_ManagementAccounts_Resource extends Google_Servic
|
|
2280 |
* @opt_param int start-index An index of the first account to retrieve. Use
|
2281 |
* this parameter as a pagination mechanism along with the max-results
|
2282 |
* parameter.
|
2283 |
-
* @return
|
2284 |
*/
|
2285 |
public function listManagementAccounts($optParams = array())
|
2286 |
{
|
2287 |
$params = array();
|
2288 |
$params = array_merge($params, $optParams);
|
2289 |
-
return $this->call('list', array($params), "
|
2290 |
}
|
2291 |
}
|
2292 |
/**
|
2293 |
* The "customDataSources" collection of methods.
|
2294 |
* Typical usage is:
|
2295 |
* <code>
|
2296 |
-
* $analyticsService = new
|
2297 |
* $customDataSources = $analyticsService->customDataSources;
|
2298 |
* </code>
|
2299 |
*/
|
2300 |
-
class
|
2301 |
{
|
2302 |
|
2303 |
/**
|
@@ -2314,24 +2314,24 @@ class Google_Service_Analytics_ManagementCustomDataSources_Resource extends Goog
|
|
2314 |
* @opt_param int start-index A 1-based index of the first custom data source to
|
2315 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
2316 |
* results parameter.
|
2317 |
-
* @return
|
2318 |
*/
|
2319 |
public function listManagementCustomDataSources($accountId, $webPropertyId, $optParams = array())
|
2320 |
{
|
2321 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
2322 |
$params = array_merge($params, $optParams);
|
2323 |
-
return $this->call('list', array($params), "
|
2324 |
}
|
2325 |
}
|
2326 |
/**
|
2327 |
* The "customDimensions" collection of methods.
|
2328 |
* Typical usage is:
|
2329 |
* <code>
|
2330 |
-
* $analyticsService = new
|
2331 |
* $customDimensions = $analyticsService->customDimensions;
|
2332 |
* </code>
|
2333 |
*/
|
2334 |
-
class
|
2335 |
{
|
2336 |
|
2337 |
/**
|
@@ -2342,13 +2342,13 @@ class Google_Service_Analytics_ManagementCustomDimensions_Resource extends Googl
|
|
2342 |
* retrieve.
|
2343 |
* @param string $customDimensionId The ID of the custom dimension to retrieve.
|
2344 |
* @param array $optParams Optional parameters.
|
2345 |
-
* @return
|
2346 |
*/
|
2347 |
public function get($accountId, $webPropertyId, $customDimensionId, $optParams = array())
|
2348 |
{
|
2349 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId);
|
2350 |
$params = array_merge($params, $optParams);
|
2351 |
-
return $this->call('get', array($params), "
|
2352 |
}
|
2353 |
|
2354 |
/**
|
@@ -2357,15 +2357,15 @@ class Google_Service_Analytics_ManagementCustomDimensions_Resource extends Googl
|
|
2357 |
* @param string $accountId Account ID for the custom dimension to create.
|
2358 |
* @param string $webPropertyId Web property ID for the custom dimension to
|
2359 |
* create.
|
2360 |
-
* @param
|
2361 |
* @param array $optParams Optional parameters.
|
2362 |
-
* @return
|
2363 |
*/
|
2364 |
-
public function insert($accountId, $webPropertyId,
|
2365 |
{
|
2366 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
2367 |
$params = array_merge($params, $optParams);
|
2368 |
-
return $this->call('insert', array($params), "
|
2369 |
}
|
2370 |
|
2371 |
/**
|
@@ -2381,13 +2381,13 @@ class Google_Service_Analytics_ManagementCustomDimensions_Resource extends Googl
|
|
2381 |
* in this response.
|
2382 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2383 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2384 |
-
* @return
|
2385 |
*/
|
2386 |
public function listManagementCustomDimensions($accountId, $webPropertyId, $optParams = array())
|
2387 |
{
|
2388 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
2389 |
$params = array_merge($params, $optParams);
|
2390 |
-
return $this->call('list', array($params), "
|
2391 |
}
|
2392 |
|
2393 |
/**
|
@@ -2399,19 +2399,19 @@ class Google_Service_Analytics_ManagementCustomDimensions_Resource extends Googl
|
|
2399 |
* update.
|
2400 |
* @param string $customDimensionId Custom dimension ID for the custom dimension
|
2401 |
* to update.
|
2402 |
-
* @param
|
2403 |
* @param array $optParams Optional parameters.
|
2404 |
*
|
2405 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2406 |
* warnings related to the custom dimension being linked to a custom data source
|
2407 |
* / data set.
|
2408 |
-
* @return
|
2409 |
*/
|
2410 |
-
public function patch($accountId, $webPropertyId, $customDimensionId,
|
2411 |
{
|
2412 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId, 'postBody' => $postBody);
|
2413 |
$params = array_merge($params, $optParams);
|
2414 |
-
return $this->call('patch', array($params), "
|
2415 |
}
|
2416 |
|
2417 |
/**
|
@@ -2422,30 +2422,30 @@ class Google_Service_Analytics_ManagementCustomDimensions_Resource extends Googl
|
|
2422 |
* update.
|
2423 |
* @param string $customDimensionId Custom dimension ID for the custom dimension
|
2424 |
* to update.
|
2425 |
-
* @param
|
2426 |
* @param array $optParams Optional parameters.
|
2427 |
*
|
2428 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2429 |
* warnings related to the custom dimension being linked to a custom data source
|
2430 |
* / data set.
|
2431 |
-
* @return
|
2432 |
*/
|
2433 |
-
public function update($accountId, $webPropertyId, $customDimensionId,
|
2434 |
{
|
2435 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId, 'postBody' => $postBody);
|
2436 |
$params = array_merge($params, $optParams);
|
2437 |
-
return $this->call('update', array($params), "
|
2438 |
}
|
2439 |
}
|
2440 |
/**
|
2441 |
* The "customMetrics" collection of methods.
|
2442 |
* Typical usage is:
|
2443 |
* <code>
|
2444 |
-
* $analyticsService = new
|
2445 |
* $customMetrics = $analyticsService->customMetrics;
|
2446 |
* </code>
|
2447 |
*/
|
2448 |
-
class
|
2449 |
{
|
2450 |
|
2451 |
/**
|
@@ -2456,13 +2456,13 @@ class Google_Service_Analytics_ManagementCustomMetrics_Resource extends Google_S
|
|
2456 |
* retrieve.
|
2457 |
* @param string $customMetricId The ID of the custom metric to retrieve.
|
2458 |
* @param array $optParams Optional parameters.
|
2459 |
-
* @return
|
2460 |
*/
|
2461 |
public function get($accountId, $webPropertyId, $customMetricId, $optParams = array())
|
2462 |
{
|
2463 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customMetricId' => $customMetricId);
|
2464 |
$params = array_merge($params, $optParams);
|
2465 |
-
return $this->call('get', array($params), "
|
2466 |
}
|
2467 |
|
2468 |
/**
|
@@ -2471,15 +2471,15 @@ class Google_Service_Analytics_ManagementCustomMetrics_Resource extends Google_S
|
|
2471 |
* @param string $accountId Account ID for the custom metric to create.
|
2472 |
* @param string $webPropertyId Web property ID for the custom dimension to
|
2473 |
* create.
|
2474 |
-
* @param
|
2475 |
* @param array $optParams Optional parameters.
|
2476 |
-
* @return
|
2477 |
*/
|
2478 |
-
public function insert($accountId, $webPropertyId,
|
2479 |
{
|
2480 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
2481 |
$params = array_merge($params, $optParams);
|
2482 |
-
return $this->call('insert', array($params), "
|
2483 |
}
|
2484 |
|
2485 |
/**
|
@@ -2495,13 +2495,13 @@ class Google_Service_Analytics_ManagementCustomMetrics_Resource extends Google_S
|
|
2495 |
* this response.
|
2496 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2497 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2498 |
-
* @return
|
2499 |
*/
|
2500 |
public function listManagementCustomMetrics($accountId, $webPropertyId, $optParams = array())
|
2501 |
{
|
2502 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
2503 |
$params = array_merge($params, $optParams);
|
2504 |
-
return $this->call('list', array($params), "
|
2505 |
}
|
2506 |
|
2507 |
/**
|
@@ -2512,19 +2512,19 @@ class Google_Service_Analytics_ManagementCustomMetrics_Resource extends Google_S
|
|
2512 |
* @param string $webPropertyId Web property ID for the custom metric to update.
|
2513 |
* @param string $customMetricId Custom metric ID for the custom metric to
|
2514 |
* update.
|
2515 |
-
* @param
|
2516 |
* @param array $optParams Optional parameters.
|
2517 |
*
|
2518 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2519 |
* warnings related to the custom metric being linked to a custom data source /
|
2520 |
* data set.
|
2521 |
-
* @return
|
2522 |
*/
|
2523 |
-
public function patch($accountId, $webPropertyId, $customMetricId,
|
2524 |
{
|
2525 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customMetricId' => $customMetricId, 'postBody' => $postBody);
|
2526 |
$params = array_merge($params, $optParams);
|
2527 |
-
return $this->call('patch', array($params), "
|
2528 |
}
|
2529 |
|
2530 |
/**
|
@@ -2534,30 +2534,30 @@ class Google_Service_Analytics_ManagementCustomMetrics_Resource extends Google_S
|
|
2534 |
* @param string $webPropertyId Web property ID for the custom metric to update.
|
2535 |
* @param string $customMetricId Custom metric ID for the custom metric to
|
2536 |
* update.
|
2537 |
-
* @param
|
2538 |
* @param array $optParams Optional parameters.
|
2539 |
*
|
2540 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2541 |
* warnings related to the custom metric being linked to a custom data source /
|
2542 |
* data set.
|
2543 |
-
* @return
|
2544 |
*/
|
2545 |
-
public function update($accountId, $webPropertyId, $customMetricId,
|
2546 |
{
|
2547 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customMetricId' => $customMetricId, 'postBody' => $postBody);
|
2548 |
$params = array_merge($params, $optParams);
|
2549 |
-
return $this->call('update', array($params), "
|
2550 |
}
|
2551 |
}
|
2552 |
/**
|
2553 |
* The "experiments" collection of methods.
|
2554 |
* Typical usage is:
|
2555 |
* <code>
|
2556 |
-
* $analyticsService = new
|
2557 |
* $experiments = $analyticsService->experiments;
|
2558 |
* </code>
|
2559 |
*/
|
2560 |
-
class
|
2561 |
{
|
2562 |
|
2563 |
/**
|
@@ -2584,13 +2584,13 @@ class Google_Service_Analytics_ManagementExperiments_Resource extends Google_Ser
|
|
2584 |
* @param string $profileId View (Profile) ID to retrieve the experiment for.
|
2585 |
* @param string $experimentId Experiment ID to retrieve the experiment for.
|
2586 |
* @param array $optParams Optional parameters.
|
2587 |
-
* @return
|
2588 |
*/
|
2589 |
public function get($accountId, $webPropertyId, $profileId, $experimentId, $optParams = array())
|
2590 |
{
|
2591 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId);
|
2592 |
$params = array_merge($params, $optParams);
|
2593 |
-
return $this->call('get', array($params), "
|
2594 |
}
|
2595 |
|
2596 |
/**
|
@@ -2599,15 +2599,15 @@ class Google_Service_Analytics_ManagementExperiments_Resource extends Google_Ser
|
|
2599 |
* @param string $accountId Account ID to create the experiment for.
|
2600 |
* @param string $webPropertyId Web property ID to create the experiment for.
|
2601 |
* @param string $profileId View (Profile) ID to create the experiment for.
|
2602 |
-
* @param
|
2603 |
* @param array $optParams Optional parameters.
|
2604 |
-
* @return
|
2605 |
*/
|
2606 |
-
public function insert($accountId, $webPropertyId, $profileId,
|
2607 |
{
|
2608 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
2609 |
$params = array_merge($params, $optParams);
|
2610 |
-
return $this->call('insert', array($params), "
|
2611 |
}
|
2612 |
|
2613 |
/**
|
@@ -2624,13 +2624,13 @@ class Google_Service_Analytics_ManagementExperiments_Resource extends Google_Ser
|
|
2624 |
* @opt_param int start-index An index of the first experiment to retrieve. Use
|
2625 |
* this parameter as a pagination mechanism along with the max-results
|
2626 |
* parameter.
|
2627 |
-
* @return
|
2628 |
*/
|
2629 |
public function listManagementExperiments($accountId, $webPropertyId, $profileId, $optParams = array())
|
2630 |
{
|
2631 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
2632 |
$params = array_merge($params, $optParams);
|
2633 |
-
return $this->call('list', array($params), "
|
2634 |
}
|
2635 |
|
2636 |
/**
|
@@ -2641,15 +2641,15 @@ class Google_Service_Analytics_ManagementExperiments_Resource extends Google_Ser
|
|
2641 |
* @param string $webPropertyId Web property ID of the experiment to update.
|
2642 |
* @param string $profileId View (Profile) ID of the experiment to update.
|
2643 |
* @param string $experimentId Experiment ID of the experiment to update.
|
2644 |
-
* @param
|
2645 |
* @param array $optParams Optional parameters.
|
2646 |
-
* @return
|
2647 |
*/
|
2648 |
-
public function patch($accountId, $webPropertyId, $profileId, $experimentId,
|
2649 |
{
|
2650 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody);
|
2651 |
$params = array_merge($params, $optParams);
|
2652 |
-
return $this->call('patch', array($params), "
|
2653 |
}
|
2654 |
|
2655 |
/**
|
@@ -2659,26 +2659,26 @@ class Google_Service_Analytics_ManagementExperiments_Resource extends Google_Ser
|
|
2659 |
* @param string $webPropertyId Web property ID of the experiment to update.
|
2660 |
* @param string $profileId View (Profile) ID of the experiment to update.
|
2661 |
* @param string $experimentId Experiment ID of the experiment to update.
|
2662 |
-
* @param
|
2663 |
* @param array $optParams Optional parameters.
|
2664 |
-
* @return
|
2665 |
*/
|
2666 |
-
public function update($accountId, $webPropertyId, $profileId, $experimentId,
|
2667 |
{
|
2668 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody);
|
2669 |
$params = array_merge($params, $optParams);
|
2670 |
-
return $this->call('update', array($params), "
|
2671 |
}
|
2672 |
}
|
2673 |
/**
|
2674 |
* The "filters" collection of methods.
|
2675 |
* Typical usage is:
|
2676 |
* <code>
|
2677 |
-
* $analyticsService = new
|
2678 |
* $filters = $analyticsService->filters;
|
2679 |
* </code>
|
2680 |
*/
|
2681 |
-
class
|
2682 |
{
|
2683 |
|
2684 |
/**
|
@@ -2687,13 +2687,13 @@ class Google_Service_Analytics_ManagementFilters_Resource extends Google_Service
|
|
2687 |
* @param string $accountId Account ID to delete the filter for.
|
2688 |
* @param string $filterId ID of the filter to be deleted.
|
2689 |
* @param array $optParams Optional parameters.
|
2690 |
-
* @return
|
2691 |
*/
|
2692 |
public function delete($accountId, $filterId, $optParams = array())
|
2693 |
{
|
2694 |
$params = array('accountId' => $accountId, 'filterId' => $filterId);
|
2695 |
$params = array_merge($params, $optParams);
|
2696 |
-
return $this->call('delete', array($params), "
|
2697 |
}
|
2698 |
|
2699 |
/**
|
@@ -2702,28 +2702,28 @@ class Google_Service_Analytics_ManagementFilters_Resource extends Google_Service
|
|
2702 |
* @param string $accountId Account ID to retrieve filters for.
|
2703 |
* @param string $filterId Filter ID to retrieve filters for.
|
2704 |
* @param array $optParams Optional parameters.
|
2705 |
-
* @return
|
2706 |
*/
|
2707 |
public function get($accountId, $filterId, $optParams = array())
|
2708 |
{
|
2709 |
$params = array('accountId' => $accountId, 'filterId' => $filterId);
|
2710 |
$params = array_merge($params, $optParams);
|
2711 |
-
return $this->call('get', array($params), "
|
2712 |
}
|
2713 |
|
2714 |
/**
|
2715 |
* Create a new filter. (filters.insert)
|
2716 |
*
|
2717 |
* @param string $accountId Account ID to create filter for.
|
2718 |
-
* @param
|
2719 |
* @param array $optParams Optional parameters.
|
2720 |
-
* @return
|
2721 |
*/
|
2722 |
-
public function insert($accountId,
|
2723 |
{
|
2724 |
$params = array('accountId' => $accountId, 'postBody' => $postBody);
|
2725 |
$params = array_merge($params, $optParams);
|
2726 |
-
return $this->call('insert', array($params), "
|
2727 |
}
|
2728 |
|
2729 |
/**
|
@@ -2736,13 +2736,13 @@ class Google_Service_Analytics_ManagementFilters_Resource extends Google_Service
|
|
2736 |
* response.
|
2737 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2738 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2739 |
-
* @return
|
2740 |
*/
|
2741 |
public function listManagementFilters($accountId, $optParams = array())
|
2742 |
{
|
2743 |
$params = array('accountId' => $accountId);
|
2744 |
$params = array_merge($params, $optParams);
|
2745 |
-
return $this->call('list', array($params), "
|
2746 |
}
|
2747 |
|
2748 |
/**
|
@@ -2751,15 +2751,15 @@ class Google_Service_Analytics_ManagementFilters_Resource extends Google_Service
|
|
2751 |
*
|
2752 |
* @param string $accountId Account ID to which the filter belongs.
|
2753 |
* @param string $filterId ID of the filter to be updated.
|
2754 |
-
* @param
|
2755 |
* @param array $optParams Optional parameters.
|
2756 |
-
* @return
|
2757 |
*/
|
2758 |
-
public function patch($accountId, $filterId,
|
2759 |
{
|
2760 |
$params = array('accountId' => $accountId, 'filterId' => $filterId, 'postBody' => $postBody);
|
2761 |
$params = array_merge($params, $optParams);
|
2762 |
-
return $this->call('patch', array($params), "
|
2763 |
}
|
2764 |
|
2765 |
/**
|
@@ -2767,26 +2767,26 @@ class Google_Service_Analytics_ManagementFilters_Resource extends Google_Service
|
|
2767 |
*
|
2768 |
* @param string $accountId Account ID to which the filter belongs.
|
2769 |
* @param string $filterId ID of the filter to be updated.
|
2770 |
-
* @param
|
2771 |
* @param array $optParams Optional parameters.
|
2772 |
-
* @return
|
2773 |
*/
|
2774 |
-
public function update($accountId, $filterId,
|
2775 |
{
|
2776 |
$params = array('accountId' => $accountId, 'filterId' => $filterId, 'postBody' => $postBody);
|
2777 |
$params = array_merge($params, $optParams);
|
2778 |
-
return $this->call('update', array($params), "
|
2779 |
}
|
2780 |
}
|
2781 |
/**
|
2782 |
* The "goals" collection of methods.
|
2783 |
* Typical usage is:
|
2784 |
* <code>
|
2785 |
-
* $analyticsService = new
|
2786 |
* $goals = $analyticsService->goals;
|
2787 |
* </code>
|
2788 |
*/
|
2789 |
-
class
|
2790 |
{
|
2791 |
|
2792 |
/**
|
@@ -2797,13 +2797,13 @@ class Google_Service_Analytics_ManagementGoals_Resource extends Google_Service_R
|
|
2797 |
* @param string $profileId View (Profile) ID to retrieve the goal for.
|
2798 |
* @param string $goalId Goal ID to retrieve the goal for.
|
2799 |
* @param array $optParams Optional parameters.
|
2800 |
-
* @return
|
2801 |
*/
|
2802 |
public function get($accountId, $webPropertyId, $profileId, $goalId, $optParams = array())
|
2803 |
{
|
2804 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId);
|
2805 |
$params = array_merge($params, $optParams);
|
2806 |
-
return $this->call('get', array($params), "
|
2807 |
}
|
2808 |
|
2809 |
/**
|
@@ -2812,15 +2812,15 @@ class Google_Service_Analytics_ManagementGoals_Resource extends Google_Service_R
|
|
2812 |
* @param string $accountId Account ID to create the goal for.
|
2813 |
* @param string $webPropertyId Web property ID to create the goal for.
|
2814 |
* @param string $profileId View (Profile) ID to create the goal for.
|
2815 |
-
* @param
|
2816 |
* @param array $optParams Optional parameters.
|
2817 |
-
* @return
|
2818 |
*/
|
2819 |
-
public function insert($accountId, $webPropertyId, $profileId,
|
2820 |
{
|
2821 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
2822 |
$params = array_merge($params, $optParams);
|
2823 |
-
return $this->call('insert', array($params), "
|
2824 |
}
|
2825 |
|
2826 |
/**
|
@@ -2841,13 +2841,13 @@ class Google_Service_Analytics_ManagementGoals_Resource extends Google_Service_R
|
|
2841 |
* response.
|
2842 |
* @opt_param int start-index An index of the first goal to retrieve. Use this
|
2843 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2844 |
-
* @return
|
2845 |
*/
|
2846 |
public function listManagementGoals($accountId, $webPropertyId, $profileId, $optParams = array())
|
2847 |
{
|
2848 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
2849 |
$params = array_merge($params, $optParams);
|
2850 |
-
return $this->call('list', array($params), "
|
2851 |
}
|
2852 |
|
2853 |
/**
|
@@ -2858,15 +2858,15 @@ class Google_Service_Analytics_ManagementGoals_Resource extends Google_Service_R
|
|
2858 |
* @param string $webPropertyId Web property ID to update the goal.
|
2859 |
* @param string $profileId View (Profile) ID to update the goal.
|
2860 |
* @param string $goalId Index of the goal to be updated.
|
2861 |
-
* @param
|
2862 |
* @param array $optParams Optional parameters.
|
2863 |
-
* @return
|
2864 |
*/
|
2865 |
-
public function patch($accountId, $webPropertyId, $profileId, $goalId,
|
2866 |
{
|
2867 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody);
|
2868 |
$params = array_merge($params, $optParams);
|
2869 |
-
return $this->call('patch', array($params), "
|
2870 |
}
|
2871 |
|
2872 |
/**
|
@@ -2876,26 +2876,26 @@ class Google_Service_Analytics_ManagementGoals_Resource extends Google_Service_R
|
|
2876 |
* @param string $webPropertyId Web property ID to update the goal.
|
2877 |
* @param string $profileId View (Profile) ID to update the goal.
|
2878 |
* @param string $goalId Index of the goal to be updated.
|
2879 |
-
* @param
|
2880 |
* @param array $optParams Optional parameters.
|
2881 |
-
* @return
|
2882 |
*/
|
2883 |
-
public function update($accountId, $webPropertyId, $profileId, $goalId,
|
2884 |
{
|
2885 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody);
|
2886 |
$params = array_merge($params, $optParams);
|
2887 |
-
return $this->call('update', array($params), "
|
2888 |
}
|
2889 |
}
|
2890 |
/**
|
2891 |
* The "profileFilterLinks" collection of methods.
|
2892 |
* Typical usage is:
|
2893 |
* <code>
|
2894 |
-
* $analyticsService = new
|
2895 |
* $profileFilterLinks = $analyticsService->profileFilterLinks;
|
2896 |
* </code>
|
2897 |
*/
|
2898 |
-
class
|
2899 |
{
|
2900 |
|
2901 |
/**
|
@@ -2924,13 +2924,13 @@ class Google_Service_Analytics_ManagementProfileFilterLinks_Resource extends Goo
|
|
2924 |
* @param string $profileId Profile ID to retrieve filter link for.
|
2925 |
* @param string $linkId ID of the profile filter link.
|
2926 |
* @param array $optParams Optional parameters.
|
2927 |
-
* @return
|
2928 |
*/
|
2929 |
public function get($accountId, $webPropertyId, $profileId, $linkId, $optParams = array())
|
2930 |
{
|
2931 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId);
|
2932 |
$params = array_merge($params, $optParams);
|
2933 |
-
return $this->call('get', array($params), "
|
2934 |
}
|
2935 |
|
2936 |
/**
|
@@ -2940,15 +2940,15 @@ class Google_Service_Analytics_ManagementProfileFilterLinks_Resource extends Goo
|
|
2940 |
* @param string $webPropertyId Web property Id to create profile filter link
|
2941 |
* for.
|
2942 |
* @param string $profileId Profile ID to create filter link for.
|
2943 |
-
* @param
|
2944 |
* @param array $optParams Optional parameters.
|
2945 |
-
* @return
|
2946 |
*/
|
2947 |
-
public function insert($accountId, $webPropertyId, $profileId,
|
2948 |
{
|
2949 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
2950 |
$params = array_merge($params, $optParams);
|
2951 |
-
return $this->call('insert', array($params), "
|
2952 |
}
|
2953 |
|
2954 |
/**
|
@@ -2968,13 +2968,13 @@ class Google_Service_Analytics_ManagementProfileFilterLinks_Resource extends Goo
|
|
2968 |
* include in this response.
|
2969 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2970 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2971 |
-
* @return
|
2972 |
*/
|
2973 |
public function listManagementProfileFilterLinks($accountId, $webPropertyId, $profileId, $optParams = array())
|
2974 |
{
|
2975 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
2976 |
$params = array_merge($params, $optParams);
|
2977 |
-
return $this->call('list', array($params), "
|
2978 |
}
|
2979 |
|
2980 |
/**
|
@@ -2986,15 +2986,15 @@ class Google_Service_Analytics_ManagementProfileFilterLinks_Resource extends Goo
|
|
2986 |
* belongs
|
2987 |
* @param string $profileId Profile ID to which filter link belongs
|
2988 |
* @param string $linkId ID of the profile filter link to be updated.
|
2989 |
-
* @param
|
2990 |
* @param array $optParams Optional parameters.
|
2991 |
-
* @return
|
2992 |
*/
|
2993 |
-
public function patch($accountId, $webPropertyId, $profileId, $linkId,
|
2994 |
{
|
2995 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody);
|
2996 |
$params = array_merge($params, $optParams);
|
2997 |
-
return $this->call('patch', array($params), "
|
2998 |
}
|
2999 |
|
3000 |
/**
|
@@ -3005,26 +3005,26 @@ class Google_Service_Analytics_ManagementProfileFilterLinks_Resource extends Goo
|
|
3005 |
* belongs
|
3006 |
* @param string $profileId Profile ID to which filter link belongs
|
3007 |
* @param string $linkId ID of the profile filter link to be updated.
|
3008 |
-
* @param
|
3009 |
* @param array $optParams Optional parameters.
|
3010 |
-
* @return
|
3011 |
*/
|
3012 |
-
public function update($accountId, $webPropertyId, $profileId, $linkId,
|
3013 |
{
|
3014 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody);
|
3015 |
$params = array_merge($params, $optParams);
|
3016 |
-
return $this->call('update', array($params), "
|
3017 |
}
|
3018 |
}
|
3019 |
/**
|
3020 |
* The "profileUserLinks" collection of methods.
|
3021 |
* Typical usage is:
|
3022 |
* <code>
|
3023 |
-
* $analyticsService = new
|
3024 |
* $profileUserLinks = $analyticsService->profileUserLinks;
|
3025 |
* </code>
|
3026 |
*/
|
3027 |
-
class
|
3028 |
{
|
3029 |
|
3030 |
/**
|
@@ -3049,15 +3049,15 @@ class Google_Service_Analytics_ManagementProfileUserLinks_Resource extends Googl
|
|
3049 |
* @param string $accountId Account ID to create the user link for.
|
3050 |
* @param string $webPropertyId Web Property ID to create the user link for.
|
3051 |
* @param string $profileId View (Profile) ID to create the user link for.
|
3052 |
-
* @param
|
3053 |
* @param array $optParams Optional parameters.
|
3054 |
-
* @return
|
3055 |
*/
|
3056 |
-
public function insert($accountId, $webPropertyId, $profileId,
|
3057 |
{
|
3058 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3059 |
$params = array_merge($params, $optParams);
|
3060 |
-
return $this->call('insert', array($params), "
|
3061 |
}
|
3062 |
|
3063 |
/**
|
@@ -3079,13 +3079,13 @@ class Google_Service_Analytics_ManagementProfileUserLinks_Resource extends Googl
|
|
3079 |
* @opt_param int start-index An index of the first profile-user link to
|
3080 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3081 |
* results parameter.
|
3082 |
-
* @return
|
3083 |
*/
|
3084 |
public function listManagementProfileUserLinks($accountId, $webPropertyId, $profileId, $optParams = array())
|
3085 |
{
|
3086 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
3087 |
$params = array_merge($params, $optParams);
|
3088 |
-
return $this->call('list', array($params), "
|
3089 |
}
|
3090 |
|
3091 |
/**
|
@@ -3096,26 +3096,26 @@ class Google_Service_Analytics_ManagementProfileUserLinks_Resource extends Googl
|
|
3096 |
* @param string $webPropertyId Web Property ID to update the user link for.
|
3097 |
* @param string $profileId View (Profile ID) to update the user link for.
|
3098 |
* @param string $linkId Link ID to update the user link for.
|
3099 |
-
* @param
|
3100 |
* @param array $optParams Optional parameters.
|
3101 |
-
* @return
|
3102 |
*/
|
3103 |
-
public function update($accountId, $webPropertyId, $profileId, $linkId,
|
3104 |
{
|
3105 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody);
|
3106 |
$params = array_merge($params, $optParams);
|
3107 |
-
return $this->call('update', array($params), "
|
3108 |
}
|
3109 |
}
|
3110 |
/**
|
3111 |
* The "profiles" collection of methods.
|
3112 |
* Typical usage is:
|
3113 |
* <code>
|
3114 |
-
* $analyticsService = new
|
3115 |
* $profiles = $analyticsService->profiles;
|
3116 |
* </code>
|
3117 |
*/
|
3118 |
-
class
|
3119 |
{
|
3120 |
|
3121 |
/**
|
@@ -3141,13 +3141,13 @@ class Google_Service_Analytics_ManagementProfiles_Resource extends Google_Servic
|
|
3141 |
* @param string $webPropertyId Web property ID to retrieve the goal for.
|
3142 |
* @param string $profileId View (Profile) ID to retrieve the goal for.
|
3143 |
* @param array $optParams Optional parameters.
|
3144 |
-
* @return
|
3145 |
*/
|
3146 |
public function get($accountId, $webPropertyId, $profileId, $optParams = array())
|
3147 |
{
|
3148 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
3149 |
$params = array_merge($params, $optParams);
|
3150 |
-
return $this->call('get', array($params), "
|
3151 |
}
|
3152 |
|
3153 |
/**
|
@@ -3156,15 +3156,15 @@ class Google_Service_Analytics_ManagementProfiles_Resource extends Google_Servic
|
|
3156 |
* @param string $accountId Account ID to create the view (profile) for.
|
3157 |
* @param string $webPropertyId Web property ID to create the view (profile)
|
3158 |
* for.
|
3159 |
-
* @param
|
3160 |
* @param array $optParams Optional parameters.
|
3161 |
-
* @return
|
3162 |
*/
|
3163 |
-
public function insert($accountId, $webPropertyId,
|
3164 |
{
|
3165 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3166 |
$params = array_merge($params, $optParams);
|
3167 |
-
return $this->call('insert', array($params), "
|
3168 |
}
|
3169 |
|
3170 |
/**
|
@@ -3183,13 +3183,13 @@ class Google_Service_Analytics_ManagementProfiles_Resource extends Google_Servic
|
|
3183 |
* in this response.
|
3184 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
3185 |
* parameter as a pagination mechanism along with the max-results parameter.
|
3186 |
-
* @return
|
3187 |
*/
|
3188 |
public function listManagementProfiles($accountId, $webPropertyId, $optParams = array())
|
3189 |
{
|
3190 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3191 |
$params = array_merge($params, $optParams);
|
3192 |
-
return $this->call('list', array($params), "
|
3193 |
}
|
3194 |
|
3195 |
/**
|
@@ -3200,15 +3200,15 @@ class Google_Service_Analytics_ManagementProfiles_Resource extends Google_Servic
|
|
3200 |
* @param string $webPropertyId Web property ID to which the view (profile)
|
3201 |
* belongs
|
3202 |
* @param string $profileId ID of the view (profile) to be updated.
|
3203 |
-
* @param
|
3204 |
* @param array $optParams Optional parameters.
|
3205 |
-
* @return
|
3206 |
*/
|
3207 |
-
public function patch($accountId, $webPropertyId, $profileId,
|
3208 |
{
|
3209 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3210 |
$params = array_merge($params, $optParams);
|
3211 |
-
return $this->call('patch', array($params), "
|
3212 |
}
|
3213 |
|
3214 |
/**
|
@@ -3218,26 +3218,26 @@ class Google_Service_Analytics_ManagementProfiles_Resource extends Google_Servic
|
|
3218 |
* @param string $webPropertyId Web property ID to which the view (profile)
|
3219 |
* belongs
|
3220 |
* @param string $profileId ID of the view (profile) to be updated.
|
3221 |
-
* @param
|
3222 |
* @param array $optParams Optional parameters.
|
3223 |
-
* @return
|
3224 |
*/
|
3225 |
-
public function update($accountId, $webPropertyId, $profileId,
|
3226 |
{
|
3227 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3228 |
$params = array_merge($params, $optParams);
|
3229 |
-
return $this->call('update', array($params), "
|
3230 |
}
|
3231 |
}
|
3232 |
/**
|
3233 |
* The "segments" collection of methods.
|
3234 |
* Typical usage is:
|
3235 |
* <code>
|
3236 |
-
* $analyticsService = new
|
3237 |
* $segments = $analyticsService->segments;
|
3238 |
* </code>
|
3239 |
*/
|
3240 |
-
class
|
3241 |
{
|
3242 |
|
3243 |
/**
|
@@ -3251,24 +3251,24 @@ class Google_Service_Analytics_ManagementSegments_Resource extends Google_Servic
|
|
3251 |
* @opt_param int start-index An index of the first segment to retrieve. Use
|
3252 |
* this parameter as a pagination mechanism along with the max-results
|
3253 |
* parameter.
|
3254 |
-
* @return
|
3255 |
*/
|
3256 |
public function listManagementSegments($optParams = array())
|
3257 |
{
|
3258 |
$params = array();
|
3259 |
$params = array_merge($params, $optParams);
|
3260 |
-
return $this->call('list', array($params), "
|
3261 |
}
|
3262 |
}
|
3263 |
/**
|
3264 |
* The "unsampledReports" collection of methods.
|
3265 |
* Typical usage is:
|
3266 |
* <code>
|
3267 |
-
* $analyticsService = new
|
3268 |
* $unsampledReports = $analyticsService->unsampledReports;
|
3269 |
* </code>
|
3270 |
*/
|
3271 |
-
class
|
3272 |
{
|
3273 |
|
3274 |
/**
|
@@ -3298,13 +3298,13 @@ class Google_Service_Analytics_ManagementUnsampledReports_Resource extends Googl
|
|
3298 |
* @param string $profileId View (Profile) ID to retrieve unsampled report for.
|
3299 |
* @param string $unsampledReportId ID of the unsampled report to retrieve.
|
3300 |
* @param array $optParams Optional parameters.
|
3301 |
-
* @return
|
3302 |
*/
|
3303 |
public function get($accountId, $webPropertyId, $profileId, $unsampledReportId, $optParams = array())
|
3304 |
{
|
3305 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'unsampledReportId' => $unsampledReportId);
|
3306 |
$params = array_merge($params, $optParams);
|
3307 |
-
return $this->call('get', array($params), "
|
3308 |
}
|
3309 |
|
3310 |
/**
|
@@ -3315,15 +3315,15 @@ class Google_Service_Analytics_ManagementUnsampledReports_Resource extends Googl
|
|
3315 |
* for.
|
3316 |
* @param string $profileId View (Profile) ID to create the unsampled report
|
3317 |
* for.
|
3318 |
-
* @param
|
3319 |
* @param array $optParams Optional parameters.
|
3320 |
-
* @return
|
3321 |
*/
|
3322 |
-
public function insert($accountId, $webPropertyId, $profileId,
|
3323 |
{
|
3324 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3325 |
$params = array_merge($params, $optParams);
|
3326 |
-
return $this->call('insert', array($params), "
|
3327 |
}
|
3328 |
|
3329 |
/**
|
@@ -3343,24 +3343,24 @@ class Google_Service_Analytics_ManagementUnsampledReports_Resource extends Googl
|
|
3343 |
* @opt_param int start-index An index of the first unsampled report to
|
3344 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3345 |
* results parameter.
|
3346 |
-
* @return
|
3347 |
*/
|
3348 |
public function listManagementUnsampledReports($accountId, $webPropertyId, $profileId, $optParams = array())
|
3349 |
{
|
3350 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
3351 |
$params = array_merge($params, $optParams);
|
3352 |
-
return $this->call('list', array($params), "
|
3353 |
}
|
3354 |
}
|
3355 |
/**
|
3356 |
* The "uploads" collection of methods.
|
3357 |
* Typical usage is:
|
3358 |
* <code>
|
3359 |
-
* $analyticsService = new
|
3360 |
* $uploads = $analyticsService->uploads;
|
3361 |
* </code>
|
3362 |
*/
|
3363 |
-
class
|
3364 |
{
|
3365 |
|
3366 |
/**
|
@@ -3370,10 +3370,10 @@ class Google_Service_Analytics_ManagementUploads_Resource extends Google_Service
|
|
3370 |
* @param string $webPropertyId Web property Id for the uploads to be deleted.
|
3371 |
* @param string $customDataSourceId Custom data source Id for the uploads to be
|
3372 |
* deleted.
|
3373 |
-
* @param
|
3374 |
* @param array $optParams Optional parameters.
|
3375 |
*/
|
3376 |
-
public function deleteUploadData($accountId, $webPropertyId, $customDataSourceId,
|
3377 |
{
|
3378 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'postBody' => $postBody);
|
3379 |
$params = array_merge($params, $optParams);
|
@@ -3389,13 +3389,13 @@ class Google_Service_Analytics_ManagementUploads_Resource extends Google_Service
|
|
3389 |
* retrieve.
|
3390 |
* @param string $uploadId Upload Id to retrieve.
|
3391 |
* @param array $optParams Optional parameters.
|
3392 |
-
* @return
|
3393 |
*/
|
3394 |
public function get($accountId, $webPropertyId, $customDataSourceId, $uploadId, $optParams = array())
|
3395 |
{
|
3396 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'uploadId' => $uploadId);
|
3397 |
$params = array_merge($params, $optParams);
|
3398 |
-
return $this->call('get', array($params), "
|
3399 |
}
|
3400 |
|
3401 |
/**
|
@@ -3412,13 +3412,13 @@ class Google_Service_Analytics_ManagementUploads_Resource extends Google_Service
|
|
3412 |
* @opt_param int start-index A 1-based index of the first upload to retrieve.
|
3413 |
* Use this parameter as a pagination mechanism along with the max-results
|
3414 |
* parameter.
|
3415 |
-
* @return
|
3416 |
*/
|
3417 |
public function listManagementUploads($accountId, $webPropertyId, $customDataSourceId, $optParams = array())
|
3418 |
{
|
3419 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId);
|
3420 |
$params = array_merge($params, $optParams);
|
3421 |
-
return $this->call('list', array($params), "
|
3422 |
}
|
3423 |
|
3424 |
/**
|
@@ -3430,24 +3430,24 @@ class Google_Service_Analytics_ManagementUploads_Resource extends Google_Service
|
|
3430 |
* @param string $customDataSourceId Custom data source Id to which the data
|
3431 |
* being uploaded belongs.
|
3432 |
* @param array $optParams Optional parameters.
|
3433 |
-
* @return
|
3434 |
*/
|
3435 |
public function uploadData($accountId, $webPropertyId, $customDataSourceId, $optParams = array())
|
3436 |
{
|
3437 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId);
|
3438 |
$params = array_merge($params, $optParams);
|
3439 |
-
return $this->call('uploadData', array($params), "
|
3440 |
}
|
3441 |
}
|
3442 |
/**
|
3443 |
* The "webPropertyAdWordsLinks" collection of methods.
|
3444 |
* Typical usage is:
|
3445 |
* <code>
|
3446 |
-
* $analyticsService = new
|
3447 |
* $webPropertyAdWordsLinks = $analyticsService->webPropertyAdWordsLinks;
|
3448 |
* </code>
|
3449 |
*/
|
3450 |
-
class
|
3451 |
{
|
3452 |
|
3453 |
/**
|
@@ -3476,13 +3476,13 @@ class Google_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource extend
|
|
3476 |
* for.
|
3477 |
* @param string $webPropertyAdWordsLinkId Web property-AdWords link ID.
|
3478 |
* @param array $optParams Optional parameters.
|
3479 |
-
* @return
|
3480 |
*/
|
3481 |
public function get($accountId, $webPropertyId, $webPropertyAdWordsLinkId, $optParams = array())
|
3482 |
{
|
3483 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId);
|
3484 |
$params = array_merge($params, $optParams);
|
3485 |
-
return $this->call('get', array($params), "
|
3486 |
}
|
3487 |
|
3488 |
/**
|
@@ -3491,15 +3491,15 @@ class Google_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource extend
|
|
3491 |
* @param string $accountId ID of the Google Analytics account to create the
|
3492 |
* link for.
|
3493 |
* @param string $webPropertyId Web property ID to create the link for.
|
3494 |
-
* @param
|
3495 |
* @param array $optParams Optional parameters.
|
3496 |
-
* @return
|
3497 |
*/
|
3498 |
-
public function insert($accountId, $webPropertyId,
|
3499 |
{
|
3500 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3501 |
$params = array_merge($params, $optParams);
|
3502 |
-
return $this->call('insert', array($params), "
|
3503 |
}
|
3504 |
|
3505 |
/**
|
@@ -3517,13 +3517,13 @@ class Google_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource extend
|
|
3517 |
* @opt_param int start-index An index of the first webProperty-AdWords link to
|
3518 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3519 |
* results parameter.
|
3520 |
-
* @return
|
3521 |
*/
|
3522 |
public function listManagementWebPropertyAdWordsLinks($accountId, $webPropertyId, $optParams = array())
|
3523 |
{
|
3524 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3525 |
$params = array_merge($params, $optParams);
|
3526 |
-
return $this->call('list', array($params), "
|
3527 |
}
|
3528 |
|
3529 |
/**
|
@@ -3535,15 +3535,15 @@ class Google_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource extend
|
|
3535 |
* @param string $webPropertyId Web property ID to retrieve the AdWords link
|
3536 |
* for.
|
3537 |
* @param string $webPropertyAdWordsLinkId Web property-AdWords link ID.
|
3538 |
-
* @param
|
3539 |
* @param array $optParams Optional parameters.
|
3540 |
-
* @return
|
3541 |
*/
|
3542 |
-
public function patch($accountId, $webPropertyId, $webPropertyAdWordsLinkId,
|
3543 |
{
|
3544 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId, 'postBody' => $postBody);
|
3545 |
$params = array_merge($params, $optParams);
|
3546 |
-
return $this->call('patch', array($params), "
|
3547 |
}
|
3548 |
|
3549 |
/**
|
@@ -3555,26 +3555,26 @@ class Google_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource extend
|
|
3555 |
* @param string $webPropertyId Web property ID to retrieve the AdWords link
|
3556 |
* for.
|
3557 |
* @param string $webPropertyAdWordsLinkId Web property-AdWords link ID.
|
3558 |
-
* @param
|
3559 |
* @param array $optParams Optional parameters.
|
3560 |
-
* @return
|
3561 |
*/
|
3562 |
-
public function update($accountId, $webPropertyId, $webPropertyAdWordsLinkId,
|
3563 |
{
|
3564 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId, 'postBody' => $postBody);
|
3565 |
$params = array_merge($params, $optParams);
|
3566 |
-
return $this->call('update', array($params), "
|
3567 |
}
|
3568 |
}
|
3569 |
/**
|
3570 |
* The "webproperties" collection of methods.
|
3571 |
* Typical usage is:
|
3572 |
* <code>
|
3573 |
-
* $analyticsService = new
|
3574 |
* $webproperties = $analyticsService->webproperties;
|
3575 |
* </code>
|
3576 |
*/
|
3577 |
-
class
|
3578 |
{
|
3579 |
|
3580 |
/**
|
@@ -3583,13 +3583,13 @@ class Google_Service_Analytics_ManagementWebproperties_Resource extends Google_S
|
|
3583 |
* @param string $accountId Account ID to retrieve the web property for.
|
3584 |
* @param string $webPropertyId ID to retrieve the web property for.
|
3585 |
* @param array $optParams Optional parameters.
|
3586 |
-
* @return
|
3587 |
*/
|
3588 |
public function get($accountId, $webPropertyId, $optParams = array())
|
3589 |
{
|
3590 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3591 |
$params = array_merge($params, $optParams);
|
3592 |
-
return $this->call('get', array($params), "
|
3593 |
}
|
3594 |
|
3595 |
/**
|
@@ -3598,15 +3598,15 @@ class Google_Service_Analytics_ManagementWebproperties_Resource extends Google_S
|
|
3598 |
* least one profile. (webproperties.insert)
|
3599 |
*
|
3600 |
* @param string $accountId Account ID to create the web property for.
|
3601 |
-
* @param
|
3602 |
* @param array $optParams Optional parameters.
|
3603 |
-
* @return
|
3604 |
*/
|
3605 |
-
public function insert($accountId,
|
3606 |
{
|
3607 |
$params = array('accountId' => $accountId, 'postBody' => $postBody);
|
3608 |
$params = array_merge($params, $optParams);
|
3609 |
-
return $this->call('insert', array($params), "
|
3610 |
}
|
3611 |
|
3612 |
/**
|
@@ -3622,13 +3622,13 @@ class Google_Service_Analytics_ManagementWebproperties_Resource extends Google_S
|
|
3622 |
* this response.
|
3623 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
3624 |
* parameter as a pagination mechanism along with the max-results parameter.
|
3625 |
-
* @return
|
3626 |
*/
|
3627 |
public function listManagementWebproperties($accountId, $optParams = array())
|
3628 |
{
|
3629 |
$params = array('accountId' => $accountId);
|
3630 |
$params = array_merge($params, $optParams);
|
3631 |
-
return $this->call('list', array($params), "
|
3632 |
}
|
3633 |
|
3634 |
/**
|
@@ -3637,15 +3637,15 @@ class Google_Service_Analytics_ManagementWebproperties_Resource extends Google_S
|
|
3637 |
*
|
3638 |
* @param string $accountId Account ID to which the web property belongs
|
3639 |
* @param string $webPropertyId Web property ID
|
3640 |
-
* @param
|
3641 |
* @param array $optParams Optional parameters.
|
3642 |
-
* @return
|
3643 |
*/
|
3644 |
-
public function patch($accountId, $webPropertyId,
|
3645 |
{
|
3646 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3647 |
$params = array_merge($params, $optParams);
|
3648 |
-
return $this->call('patch', array($params), "
|
3649 |
}
|
3650 |
|
3651 |
/**
|
@@ -3653,26 +3653,26 @@ class Google_Service_Analytics_ManagementWebproperties_Resource extends Google_S
|
|
3653 |
*
|
3654 |
* @param string $accountId Account ID to which the web property belongs
|
3655 |
* @param string $webPropertyId Web property ID
|
3656 |
-
* @param
|
3657 |
* @param array $optParams Optional parameters.
|
3658 |
-
* @return
|
3659 |
*/
|
3660 |
-
public function update($accountId, $webPropertyId,
|
3661 |
{
|
3662 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3663 |
$params = array_merge($params, $optParams);
|
3664 |
-
return $this->call('update', array($params), "
|
3665 |
}
|
3666 |
}
|
3667 |
/**
|
3668 |
* The "webpropertyUserLinks" collection of methods.
|
3669 |
* Typical usage is:
|
3670 |
* <code>
|
3671 |
-
* $analyticsService = new
|
3672 |
* $webpropertyUserLinks = $analyticsService->webpropertyUserLinks;
|
3673 |
* </code>
|
3674 |
*/
|
3675 |
-
class
|
3676 |
{
|
3677 |
|
3678 |
/**
|
@@ -3695,15 +3695,15 @@ class Google_Service_Analytics_ManagementWebpropertyUserLinks_Resource extends G
|
|
3695 |
*
|
3696 |
* @param string $accountId Account ID to create the user link for.
|
3697 |
* @param string $webPropertyId Web Property ID to create the user link for.
|
3698 |
-
* @param
|
3699 |
* @param array $optParams Optional parameters.
|
3700 |
-
* @return
|
3701 |
*/
|
3702 |
-
public function insert($accountId, $webPropertyId,
|
3703 |
{
|
3704 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3705 |
$params = array_merge($params, $optParams);
|
3706 |
-
return $this->call('insert', array($params), "
|
3707 |
}
|
3708 |
|
3709 |
/**
|
@@ -3721,13 +3721,13 @@ class Google_Service_Analytics_ManagementWebpropertyUserLinks_Resource extends G
|
|
3721 |
* @opt_param int start-index An index of the first webProperty-user link to
|
3722 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3723 |
* results parameter.
|
3724 |
-
* @return
|
3725 |
*/
|
3726 |
public function listManagementWebpropertyUserLinks($accountId, $webPropertyId, $optParams = array())
|
3727 |
{
|
3728 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3729 |
$params = array_merge($params, $optParams);
|
3730 |
-
return $this->call('list', array($params), "
|
3731 |
}
|
3732 |
|
3733 |
/**
|
@@ -3738,15 +3738,15 @@ class Google_Service_Analytics_ManagementWebpropertyUserLinks_Resource extends G
|
|
3738 |
* @param string $webPropertyId Web property ID to update the account-user link
|
3739 |
* for.
|
3740 |
* @param string $linkId Link ID to update the account-user link for.
|
3741 |
-
* @param
|
3742 |
* @param array $optParams Optional parameters.
|
3743 |
-
* @return
|
3744 |
*/
|
3745 |
-
public function update($accountId, $webPropertyId, $linkId,
|
3746 |
{
|
3747 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId, 'postBody' => $postBody);
|
3748 |
$params = array_merge($params, $optParams);
|
3749 |
-
return $this->call('update', array($params), "
|
3750 |
}
|
3751 |
}
|
3752 |
|
@@ -3754,11 +3754,11 @@ class Google_Service_Analytics_ManagementWebpropertyUserLinks_Resource extends G
|
|
3754 |
* The "metadata" collection of methods.
|
3755 |
* Typical usage is:
|
3756 |
* <code>
|
3757 |
-
* $analyticsService = new
|
3758 |
* $metadata = $analyticsService->metadata;
|
3759 |
* </code>
|
3760 |
*/
|
3761 |
-
class
|
3762 |
{
|
3763 |
}
|
3764 |
|
@@ -3766,11 +3766,11 @@ class Google_Service_Analytics_Metadata_Resource extends Google_Service_Resource
|
|
3766 |
* The "columns" collection of methods.
|
3767 |
* Typical usage is:
|
3768 |
* <code>
|
3769 |
-
* $analyticsService = new
|
3770 |
* $columns = $analyticsService->columns;
|
3771 |
* </code>
|
3772 |
*/
|
3773 |
-
class
|
3774 |
{
|
3775 |
|
3776 |
/**
|
@@ -3779,13 +3779,13 @@ class Google_Service_Analytics_MetadataColumns_Resource extends Google_Service_R
|
|
3779 |
* @param string $reportType Report type. Allowed Values: 'ga'. Where 'ga'
|
3780 |
* corresponds to the Core Reporting API
|
3781 |
* @param array $optParams Optional parameters.
|
3782 |
-
* @return
|
3783 |
*/
|
3784 |
public function listMetadataColumns($reportType, $optParams = array())
|
3785 |
{
|
3786 |
$params = array('reportType' => $reportType);
|
3787 |
$params = array_merge($params, $optParams);
|
3788 |
-
return $this->call('list', array($params), "
|
3789 |
}
|
3790 |
}
|
3791 |
|
@@ -3793,48 +3793,48 @@ class Google_Service_Analytics_MetadataColumns_Resource extends Google_Service_R
|
|
3793 |
* The "provisioning" collection of methods.
|
3794 |
* Typical usage is:
|
3795 |
* <code>
|
3796 |
-
* $analyticsService = new
|
3797 |
* $provisioning = $analyticsService->provisioning;
|
3798 |
* </code>
|
3799 |
*/
|
3800 |
-
class
|
3801 |
{
|
3802 |
|
3803 |
/**
|
3804 |
* Creates an account ticket. (provisioning.createAccountTicket)
|
3805 |
*
|
3806 |
-
* @param
|
3807 |
* @param array $optParams Optional parameters.
|
3808 |
-
* @return
|
3809 |
*/
|
3810 |
-
public function createAccountTicket(
|
3811 |
{
|
3812 |
$params = array('postBody' => $postBody);
|
3813 |
$params = array_merge($params, $optParams);
|
3814 |
-
return $this->call('createAccountTicket', array($params), "
|
3815 |
}
|
3816 |
}
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
-
class
|
3822 |
{
|
3823 |
protected $internal_gapi_mappings = array(
|
3824 |
);
|
3825 |
-
protected $childLinkType = '
|
3826 |
protected $childLinkDataType = '';
|
3827 |
public $created;
|
3828 |
public $id;
|
3829 |
public $kind;
|
3830 |
public $name;
|
3831 |
-
protected $permissionsType = '
|
3832 |
protected $permissionsDataType = '';
|
3833 |
public $selfLink;
|
3834 |
public $updated;
|
3835 |
|
3836 |
|
3837 |
-
public function setChildLink(
|
3838 |
{
|
3839 |
$this->childLink = $childLink;
|
3840 |
}
|
@@ -3874,7 +3874,7 @@ class Google_Service_Analytics_Account extends Google_Model
|
|
3874 |
{
|
3875 |
return $this->name;
|
3876 |
}
|
3877 |
-
public function setPermissions(
|
3878 |
{
|
3879 |
$this->permissions = $permissions;
|
3880 |
}
|
@@ -3900,7 +3900,7 @@ class Google_Service_Analytics_Account extends Google_Model
|
|
3900 |
}
|
3901 |
}
|
3902 |
|
3903 |
-
class
|
3904 |
{
|
3905 |
protected $internal_gapi_mappings = array(
|
3906 |
);
|
@@ -3926,7 +3926,7 @@ class Google_Service_Analytics_AccountChildLink extends Google_Model
|
|
3926 |
}
|
3927 |
}
|
3928 |
|
3929 |
-
class
|
3930 |
{
|
3931 |
protected $collection_key = 'effective';
|
3932 |
protected $internal_gapi_mappings = array(
|
@@ -3944,7 +3944,7 @@ class Google_Service_Analytics_AccountPermissions extends Google_Collection
|
|
3944 |
}
|
3945 |
}
|
3946 |
|
3947 |
-
class
|
3948 |
{
|
3949 |
protected $internal_gapi_mappings = array(
|
3950 |
);
|
@@ -3988,12 +3988,12 @@ class Google_Service_Analytics_AccountRef extends Google_Model
|
|
3988 |
}
|
3989 |
}
|
3990 |
|
3991 |
-
class
|
3992 |
{
|
3993 |
protected $collection_key = 'items';
|
3994 |
protected $internal_gapi_mappings = array(
|
3995 |
);
|
3996 |
-
protected $itemsType = '
|
3997 |
protected $itemsDataType = 'array';
|
3998 |
public $itemsPerPage;
|
3999 |
public $kind;
|
@@ -4070,7 +4070,7 @@ class Google_Service_Analytics_AccountSummaries extends Google_Collection
|
|
4070 |
}
|
4071 |
}
|
4072 |
|
4073 |
-
class
|
4074 |
{
|
4075 |
protected $collection_key = 'webProperties';
|
4076 |
protected $internal_gapi_mappings = array(
|
@@ -4078,7 +4078,7 @@ class Google_Service_Analytics_AccountSummary extends Google_Collection
|
|
4078 |
public $id;
|
4079 |
public $kind;
|
4080 |
public $name;
|
4081 |
-
protected $webPropertiesType = '
|
4082 |
protected $webPropertiesDataType = 'array';
|
4083 |
|
4084 |
|
@@ -4116,22 +4116,22 @@ class Google_Service_Analytics_AccountSummary extends Google_Collection
|
|
4116 |
}
|
4117 |
}
|
4118 |
|
4119 |
-
class
|
4120 |
{
|
4121 |
protected $internal_gapi_mappings = array(
|
4122 |
);
|
4123 |
-
protected $accountType = '
|
4124 |
protected $accountDataType = '';
|
4125 |
public $id;
|
4126 |
public $kind;
|
4127 |
-
protected $profileType = '
|
4128 |
protected $profileDataType = '';
|
4129 |
public $redirectUri;
|
4130 |
-
protected $webpropertyType = '
|
4131 |
protected $webpropertyDataType = '';
|
4132 |
|
4133 |
|
4134 |
-
public function setAccount(
|
4135 |
{
|
4136 |
$this->account = $account;
|
4137 |
}
|
@@ -4155,7 +4155,7 @@ class Google_Service_Analytics_AccountTicket extends Google_Model
|
|
4155 |
{
|
4156 |
return $this->kind;
|
4157 |
}
|
4158 |
-
public function setProfile(
|
4159 |
{
|
4160 |
$this->profile = $profile;
|
4161 |
}
|
@@ -4171,7 +4171,7 @@ class Google_Service_Analytics_AccountTicket extends Google_Model
|
|
4171 |
{
|
4172 |
return $this->redirectUri;
|
4173 |
}
|
4174 |
-
public function setWebproperty(
|
4175 |
{
|
4176 |
$this->webproperty = $webproperty;
|
4177 |
}
|
@@ -4181,12 +4181,12 @@ class Google_Service_Analytics_AccountTicket extends Google_Model
|
|
4181 |
}
|
4182 |
}
|
4183 |
|
4184 |
-
class
|
4185 |
{
|
4186 |
protected $collection_key = 'items';
|
4187 |
protected $internal_gapi_mappings = array(
|
4188 |
);
|
4189 |
-
protected $itemsType = '
|
4190 |
protected $itemsDataType = 'array';
|
4191 |
public $itemsPerPage;
|
4192 |
public $kind;
|
@@ -4263,7 +4263,7 @@ class Google_Service_Analytics_Accounts extends Google_Collection
|
|
4263 |
}
|
4264 |
}
|
4265 |
|
4266 |
-
class
|
4267 |
{
|
4268 |
protected $internal_gapi_mappings = array(
|
4269 |
);
|
@@ -4298,7 +4298,7 @@ class Google_Service_Analytics_AdWordsAccount extends Google_Model
|
|
4298 |
}
|
4299 |
}
|
4300 |
|
4301 |
-
class
|
4302 |
{
|
4303 |
protected $collection_key = 'customDataImportUids';
|
4304 |
protected $internal_gapi_mappings = array(
|
@@ -4316,7 +4316,7 @@ class Google_Service_Analytics_AnalyticsDataimportDeleteUploadDataRequest extend
|
|
4316 |
}
|
4317 |
}
|
4318 |
|
4319 |
-
class
|
4320 |
{
|
4321 |
protected $internal_gapi_mappings = array(
|
4322 |
);
|
@@ -4351,14 +4351,14 @@ class Google_Service_Analytics_Column extends Google_Model
|
|
4351 |
}
|
4352 |
}
|
4353 |
|
4354 |
-
class
|
4355 |
{
|
4356 |
protected $collection_key = 'items';
|
4357 |
protected $internal_gapi_mappings = array(
|
4358 |
);
|
4359 |
public $attributeNames;
|
4360 |
public $etag;
|
4361 |
-
protected $itemsType = '
|
4362 |
protected $itemsDataType = 'array';
|
4363 |
public $kind;
|
4364 |
public $totalResults;
|
@@ -4406,13 +4406,13 @@ class Google_Service_Analytics_Columns extends Google_Collection
|
|
4406 |
}
|
4407 |
}
|
4408 |
|
4409 |
-
class
|
4410 |
{
|
4411 |
protected $collection_key = 'profilesLinked';
|
4412 |
protected $internal_gapi_mappings = array(
|
4413 |
);
|
4414 |
public $accountId;
|
4415 |
-
protected $childLinkType = '
|
4416 |
protected $childLinkDataType = '';
|
4417 |
public $created;
|
4418 |
public $description;
|
@@ -4420,7 +4420,7 @@ class Google_Service_Analytics_CustomDataSource extends Google_Collection
|
|
4420 |
public $importBehavior;
|
4421 |
public $kind;
|
4422 |
public $name;
|
4423 |
-
protected $parentLinkType = '
|
4424 |
protected $parentLinkDataType = '';
|
4425 |
public $profilesLinked;
|
4426 |
public $selfLink;
|
@@ -4438,7 +4438,7 @@ class Google_Service_Analytics_CustomDataSource extends Google_Collection
|
|
4438 |
{
|
4439 |
return $this->accountId;
|
4440 |
}
|
4441 |
-
public function setChildLink(
|
4442 |
{
|
4443 |
$this->childLink = $childLink;
|
4444 |
}
|
@@ -4494,7 +4494,7 @@ class Google_Service_Analytics_CustomDataSource extends Google_Collection
|
|
4494 |
{
|
4495 |
return $this->name;
|
4496 |
}
|
4497 |
-
public function setParentLink(
|
4498 |
{
|
4499 |
$this->parentLink = $parentLink;
|
4500 |
}
|
@@ -4552,7 +4552,7 @@ class Google_Service_Analytics_CustomDataSource extends Google_Collection
|
|
4552 |
}
|
4553 |
}
|
4554 |
|
4555 |
-
class
|
4556 |
{
|
4557 |
protected $internal_gapi_mappings = array(
|
4558 |
);
|
@@ -4578,7 +4578,7 @@ class Google_Service_Analytics_CustomDataSourceChildLink extends Google_Model
|
|
4578 |
}
|
4579 |
}
|
4580 |
|
4581 |
-
class
|
4582 |
{
|
4583 |
protected $internal_gapi_mappings = array(
|
4584 |
);
|
@@ -4604,12 +4604,12 @@ class Google_Service_Analytics_CustomDataSourceParentLink extends Google_Model
|
|
4604 |
}
|
4605 |
}
|
4606 |
|
4607 |
-
class
|
4608 |
{
|
4609 |
protected $collection_key = 'items';
|
4610 |
protected $internal_gapi_mappings = array(
|
4611 |
);
|
4612 |
-
protected $itemsType = '
|
4613 |
protected $itemsDataType = 'array';
|
4614 |
public $itemsPerPage;
|
4615 |
public $kind;
|
@@ -4686,7 +4686,7 @@ class Google_Service_Analytics_CustomDataSources extends Google_Collection
|
|
4686 |
}
|
4687 |
}
|
4688 |
|
4689 |
-
class
|
4690 |
{
|
4691 |
protected $internal_gapi_mappings = array(
|
4692 |
);
|
@@ -4697,7 +4697,7 @@ class Google_Service_Analytics_CustomDimension extends Google_Model
|
|
4697 |
public $index;
|
4698 |
public $kind;
|
4699 |
public $name;
|
4700 |
-
protected $parentLinkType = '
|
4701 |
protected $parentLinkDataType = '';
|
4702 |
public $scope;
|
4703 |
public $selfLink;
|
@@ -4761,7 +4761,7 @@ class Google_Service_Analytics_CustomDimension extends Google_Model
|
|
4761 |
{
|
4762 |
return $this->name;
|
4763 |
}
|
4764 |
-
public function setParentLink(
|
4765 |
{
|
4766 |
$this->parentLink = $parentLink;
|
4767 |
}
|
@@ -4803,7 +4803,7 @@ class Google_Service_Analytics_CustomDimension extends Google_Model
|
|
4803 |
}
|
4804 |
}
|
4805 |
|
4806 |
-
class
|
4807 |
{
|
4808 |
protected $internal_gapi_mappings = array(
|
4809 |
);
|
@@ -4829,12 +4829,12 @@ class Google_Service_Analytics_CustomDimensionParentLink extends Google_Model
|
|
4829 |
}
|
4830 |
}
|
4831 |
|
4832 |
-
class
|
4833 |
{
|
4834 |
protected $collection_key = 'items';
|
4835 |
protected $internal_gapi_mappings = array(
|
4836 |
);
|
4837 |
-
protected $itemsType = '
|
4838 |
protected $itemsDataType = 'array';
|
4839 |
public $itemsPerPage;
|
4840 |
public $kind;
|
@@ -4911,7 +4911,7 @@ class Google_Service_Analytics_CustomDimensions extends Google_Collection
|
|
4911 |
}
|
4912 |
}
|
4913 |
|
4914 |
-
class
|
4915 |
{
|
4916 |
protected $internal_gapi_mappings = array(
|
4917 |
"maxValue" => "max_value",
|
@@ -4926,7 +4926,7 @@ class Google_Service_Analytics_CustomMetric extends Google_Model
|
|
4926 |
public $maxValue;
|
4927 |
public $minValue;
|
4928 |
public $name;
|
4929 |
-
protected $parentLinkType = '
|
4930 |
protected $parentLinkDataType = '';
|
4931 |
public $scope;
|
4932 |
public $selfLink;
|
@@ -5007,7 +5007,7 @@ class Google_Service_Analytics_CustomMetric extends Google_Model
|
|
5007 |
{
|
5008 |
return $this->name;
|
5009 |
}
|
5010 |
-
public function setParentLink(
|
5011 |
{
|
5012 |
$this->parentLink = $parentLink;
|
5013 |
}
|
@@ -5057,7 +5057,7 @@ class Google_Service_Analytics_CustomMetric extends Google_Model
|
|
5057 |
}
|
5058 |
}
|
5059 |
|
5060 |
-
class
|
5061 |
{
|
5062 |
protected $internal_gapi_mappings = array(
|
5063 |
);
|
@@ -5083,12 +5083,12 @@ class Google_Service_Analytics_CustomMetricParentLink extends Google_Model
|
|
5083 |
}
|
5084 |
}
|
5085 |
|
5086 |
-
class
|
5087 |
{
|
5088 |
protected $collection_key = 'items';
|
5089 |
protected $internal_gapi_mappings = array(
|
5090 |
);
|
5091 |
-
protected $itemsType = '
|
5092 |
protected $itemsDataType = 'array';
|
5093 |
public $itemsPerPage;
|
5094 |
public $kind;
|
@@ -5165,14 +5165,14 @@ class Google_Service_Analytics_CustomMetrics extends Google_Collection
|
|
5165 |
}
|
5166 |
}
|
5167 |
|
5168 |
-
class
|
5169 |
{
|
5170 |
protected $collection_key = 'profileIds';
|
5171 |
protected $internal_gapi_mappings = array(
|
5172 |
);
|
5173 |
-
protected $adWordsAccountsType = '
|
5174 |
protected $adWordsAccountsDataType = 'array';
|
5175 |
-
protected $entityType = '
|
5176 |
protected $entityDataType = '';
|
5177 |
public $id;
|
5178 |
public $kind;
|
@@ -5189,7 +5189,7 @@ class Google_Service_Analytics_EntityAdWordsLink extends Google_Collection
|
|
5189 |
{
|
5190 |
return $this->adWordsAccounts;
|
5191 |
}
|
5192 |
-
public function setEntity(
|
5193 |
{
|
5194 |
$this->entity = $entity;
|
5195 |
}
|
@@ -5239,15 +5239,15 @@ class Google_Service_Analytics_EntityAdWordsLink extends Google_Collection
|
|
5239 |
}
|
5240 |
}
|
5241 |
|
5242 |
-
class
|
5243 |
{
|
5244 |
protected $internal_gapi_mappings = array(
|
5245 |
);
|
5246 |
-
protected $webPropertyRefType = '
|
5247 |
protected $webPropertyRefDataType = '';
|
5248 |
|
5249 |
|
5250 |
-
public function setWebPropertyRef(
|
5251 |
{
|
5252 |
$this->webPropertyRef = $webPropertyRef;
|
5253 |
}
|
@@ -5257,12 +5257,12 @@ class Google_Service_Analytics_EntityAdWordsLinkEntity extends Google_Model
|
|
5257 |
}
|
5258 |
}
|
5259 |
|
5260 |
-
class
|
5261 |
{
|
5262 |
protected $collection_key = 'items';
|
5263 |
protected $internal_gapi_mappings = array(
|
5264 |
);
|
5265 |
-
protected $itemsType = '
|
5266 |
protected $itemsDataType = 'array';
|
5267 |
public $itemsPerPage;
|
5268 |
public $kind;
|
@@ -5330,22 +5330,22 @@ class Google_Service_Analytics_EntityAdWordsLinks extends Google_Collection
|
|
5330 |
}
|
5331 |
}
|
5332 |
|
5333 |
-
class
|
5334 |
{
|
5335 |
protected $internal_gapi_mappings = array(
|
5336 |
);
|
5337 |
-
protected $entityType = '
|
5338 |
protected $entityDataType = '';
|
5339 |
public $id;
|
5340 |
public $kind;
|
5341 |
-
protected $permissionsType = '
|
5342 |
protected $permissionsDataType = '';
|
5343 |
public $selfLink;
|
5344 |
-
protected $userRefType = '
|
5345 |
protected $userRefDataType = '';
|
5346 |
|
5347 |
|
5348 |
-
public function setEntity(
|
5349 |
{
|
5350 |
$this->entity = $entity;
|
5351 |
}
|
@@ -5369,7 +5369,7 @@ class Google_Service_Analytics_EntityUserLink extends Google_Model
|
|
5369 |
{
|
5370 |
return $this->kind;
|
5371 |
}
|
5372 |
-
public function setPermissions(
|
5373 |
{
|
5374 |
$this->permissions = $permissions;
|
5375 |
}
|
@@ -5385,7 +5385,7 @@ class Google_Service_Analytics_EntityUserLink extends Google_Model
|
|
5385 |
{
|
5386 |
return $this->selfLink;
|
5387 |
}
|
5388 |
-
public function setUserRef(
|
5389 |
{
|
5390 |
$this->userRef = $userRef;
|
5391 |
}
|
@@ -5395,19 +5395,19 @@ class Google_Service_Analytics_EntityUserLink extends Google_Model
|
|
5395 |
}
|
5396 |
}
|
5397 |
|
5398 |
-
class
|
5399 |
{
|
5400 |
protected $internal_gapi_mappings = array(
|
5401 |
);
|
5402 |
-
protected $accountRefType = '
|
5403 |
protected $accountRefDataType = '';
|
5404 |
-
protected $profileRefType = '
|
5405 |
protected $profileRefDataType = '';
|
5406 |
-
protected $webPropertyRefType = '
|
5407 |
protected $webPropertyRefDataType = '';
|
5408 |
|
5409 |
|
5410 |
-
public function setAccountRef(
|
5411 |
{
|
5412 |
$this->accountRef = $accountRef;
|
5413 |
}
|
@@ -5415,7 +5415,7 @@ class Google_Service_Analytics_EntityUserLinkEntity extends Google_Model
|
|
5415 |
{
|
5416 |
return $this->accountRef;
|
5417 |
}
|
5418 |
-
public function setProfileRef(
|
5419 |
{
|
5420 |
$this->profileRef = $profileRef;
|
5421 |
}
|
@@ -5423,7 +5423,7 @@ class Google_Service_Analytics_EntityUserLinkEntity extends Google_Model
|
|
5423 |
{
|
5424 |
return $this->profileRef;
|
5425 |
}
|
5426 |
-
public function setWebPropertyRef(
|
5427 |
{
|
5428 |
$this->webPropertyRef = $webPropertyRef;
|
5429 |
}
|
@@ -5433,7 +5433,7 @@ class Google_Service_Analytics_EntityUserLinkEntity extends Google_Model
|
|
5433 |
}
|
5434 |
}
|
5435 |
|
5436 |
-
class
|
5437 |
{
|
5438 |
protected $collection_key = 'local';
|
5439 |
protected $internal_gapi_mappings = array(
|
@@ -5460,12 +5460,12 @@ class Google_Service_Analytics_EntityUserLinkPermissions extends Google_Collecti
|
|
5460 |
}
|
5461 |
}
|
5462 |
|
5463 |
-
class
|
5464 |
{
|
5465 |
protected $collection_key = 'items';
|
5466 |
protected $internal_gapi_mappings = array(
|
5467 |
);
|
5468 |
-
protected $itemsType = '
|
5469 |
protected $itemsDataType = 'array';
|
5470 |
public $itemsPerPage;
|
5471 |
public $kind;
|
@@ -5533,7 +5533,7 @@ class Google_Service_Analytics_EntityUserLinks extends Google_Collection
|
|
5533 |
}
|
5534 |
}
|
5535 |
|
5536 |
-
class
|
5537 |
{
|
5538 |
protected $collection_key = 'variations';
|
5539 |
protected $internal_gapi_mappings = array(
|
@@ -5551,7 +5551,7 @@ class Google_Service_Analytics_Experiment extends Google_Collection
|
|
5551 |
public $name;
|
5552 |
public $objectiveMetric;
|
5553 |
public $optimizationType;
|
5554 |
-
protected $parentLinkType = '
|
5555 |
protected $parentLinkDataType = '';
|
5556 |
public $profileId;
|
5557 |
public $reasonExperimentEnded;
|
@@ -5563,7 +5563,7 @@ class Google_Service_Analytics_Experiment extends Google_Collection
|
|
5563 |
public $status;
|
5564 |
public $trafficCoverage;
|
5565 |
public $updated;
|
5566 |
-
protected $variationsType = '
|
5567 |
protected $variationsDataType = 'array';
|
5568 |
public $webPropertyId;
|
5569 |
public $winnerConfidenceLevel;
|
@@ -5674,7 +5674,7 @@ class Google_Service_Analytics_Experiment extends Google_Collection
|
|
5674 |
{
|
5675 |
return $this->optimizationType;
|
5676 |
}
|
5677 |
-
public function setParentLink(
|
5678 |
{
|
5679 |
$this->parentLink = $parentLink;
|
5680 |
}
|
@@ -5796,7 +5796,7 @@ class Google_Service_Analytics_Experiment extends Google_Collection
|
|
5796 |
}
|
5797 |
}
|
5798 |
|
5799 |
-
class
|
5800 |
{
|
5801 |
protected $internal_gapi_mappings = array(
|
5802 |
);
|
@@ -5822,7 +5822,7 @@ class Google_Service_Analytics_ExperimentParentLink extends Google_Model
|
|
5822 |
}
|
5823 |
}
|
5824 |
|
5825 |
-
class
|
5826 |
{
|
5827 |
protected $internal_gapi_mappings = array(
|
5828 |
);
|
@@ -5875,12 +5875,12 @@ class Google_Service_Analytics_ExperimentVariations extends Google_Model
|
|
5875 |
}
|
5876 |
}
|
5877 |
|
5878 |
-
class
|
5879 |
{
|
5880 |
protected $collection_key = 'items';
|
5881 |
protected $internal_gapi_mappings = array(
|
5882 |
);
|
5883 |
-
protected $itemsType = '
|
5884 |
protected $itemsDataType = 'array';
|
5885 |
public $itemsPerPage;
|
5886 |
public $kind;
|
@@ -5957,31 +5957,31 @@ class Google_Service_Analytics_Experiments extends Google_Collection
|
|
5957 |
}
|
5958 |
}
|
5959 |
|
5960 |
-
class
|
5961 |
{
|
5962 |
protected $internal_gapi_mappings = array(
|
5963 |
);
|
5964 |
public $accountId;
|
5965 |
-
protected $advancedDetailsType = '
|
5966 |
protected $advancedDetailsDataType = '';
|
5967 |
public $created;
|
5968 |
-
protected $excludeDetailsType = '
|
5969 |
protected $excludeDetailsDataType = '';
|
5970 |
public $id;
|
5971 |
-
protected $includeDetailsType = '
|
5972 |
protected $includeDetailsDataType = '';
|
5973 |
public $kind;
|
5974 |
-
protected $lowercaseDetailsType = '
|
5975 |
protected $lowercaseDetailsDataType = '';
|
5976 |
public $name;
|
5977 |
-
protected $parentLinkType = '
|
5978 |
protected $parentLinkDataType = '';
|
5979 |
-
protected $searchAndReplaceDetailsType = '
|
5980 |
protected $searchAndReplaceDetailsDataType = '';
|
5981 |
public $selfLink;
|
5982 |
public $type;
|
5983 |
public $updated;
|
5984 |
-
protected $uppercaseDetailsType = '
|
5985 |
protected $uppercaseDetailsDataType = '';
|
5986 |
|
5987 |
|
@@ -5993,7 +5993,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
5993 |
{
|
5994 |
return $this->accountId;
|
5995 |
}
|
5996 |
-
public function setAdvancedDetails(
|
5997 |
{
|
5998 |
$this->advancedDetails = $advancedDetails;
|
5999 |
}
|
@@ -6009,7 +6009,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6009 |
{
|
6010 |
return $this->created;
|
6011 |
}
|
6012 |
-
public function setExcludeDetails(
|
6013 |
{
|
6014 |
$this->excludeDetails = $excludeDetails;
|
6015 |
}
|
@@ -6025,7 +6025,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6025 |
{
|
6026 |
return $this->id;
|
6027 |
}
|
6028 |
-
public function setIncludeDetails(
|
6029 |
{
|
6030 |
$this->includeDetails = $includeDetails;
|
6031 |
}
|
@@ -6041,7 +6041,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6041 |
{
|
6042 |
return $this->kind;
|
6043 |
}
|
6044 |
-
public function setLowercaseDetails(
|
6045 |
{
|
6046 |
$this->lowercaseDetails = $lowercaseDetails;
|
6047 |
}
|
@@ -6057,7 +6057,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6057 |
{
|
6058 |
return $this->name;
|
6059 |
}
|
6060 |
-
public function setParentLink(
|
6061 |
{
|
6062 |
$this->parentLink = $parentLink;
|
6063 |
}
|
@@ -6065,7 +6065,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6065 |
{
|
6066 |
return $this->parentLink;
|
6067 |
}
|
6068 |
-
public function setSearchAndReplaceDetails(
|
6069 |
{
|
6070 |
$this->searchAndReplaceDetails = $searchAndReplaceDetails;
|
6071 |
}
|
@@ -6097,7 +6097,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6097 |
{
|
6098 |
return $this->updated;
|
6099 |
}
|
6100 |
-
public function setUppercaseDetails(
|
6101 |
{
|
6102 |
$this->uppercaseDetails = $uppercaseDetails;
|
6103 |
}
|
@@ -6107,7 +6107,7 @@ class Google_Service_Analytics_Filter extends Google_Model
|
|
6107 |
}
|
6108 |
}
|
6109 |
|
6110 |
-
class
|
6111 |
{
|
6112 |
protected $internal_gapi_mappings = array(
|
6113 |
);
|
@@ -6232,7 +6232,7 @@ class Google_Service_Analytics_FilterAdvancedDetails extends Google_Model
|
|
6232 |
}
|
6233 |
}
|
6234 |
|
6235 |
-
class
|
6236 |
{
|
6237 |
protected $internal_gapi_mappings = array(
|
6238 |
);
|
@@ -6294,7 +6294,7 @@ class Google_Service_Analytics_FilterExpression extends Google_Model
|
|
6294 |
}
|
6295 |
}
|
6296 |
|
6297 |
-
class
|
6298 |
{
|
6299 |
protected $internal_gapi_mappings = array(
|
6300 |
);
|
@@ -6320,7 +6320,7 @@ class Google_Service_Analytics_FilterLowercaseDetails extends Google_Model
|
|
6320 |
}
|
6321 |
}
|
6322 |
|
6323 |
-
class
|
6324 |
{
|
6325 |
protected $internal_gapi_mappings = array(
|
6326 |
);
|
@@ -6346,7 +6346,7 @@ class Google_Service_Analytics_FilterParentLink extends Google_Model
|
|
6346 |
}
|
6347 |
}
|
6348 |
|
6349 |
-
class
|
6350 |
{
|
6351 |
protected $internal_gapi_mappings = array(
|
6352 |
);
|
@@ -6399,7 +6399,7 @@ class Google_Service_Analytics_FilterRef extends Google_Model
|
|
6399 |
}
|
6400 |
}
|
6401 |
|
6402 |
-
class
|
6403 |
{
|
6404 |
protected $internal_gapi_mappings = array(
|
6405 |
);
|
@@ -6452,7 +6452,7 @@ class Google_Service_Analytics_FilterSearchAndReplaceDetails extends Google_Mode
|
|
6452 |
}
|
6453 |
}
|
6454 |
|
6455 |
-
class
|
6456 |
{
|
6457 |
protected $internal_gapi_mappings = array(
|
6458 |
);
|
@@ -6478,12 +6478,12 @@ class Google_Service_Analytics_FilterUppercaseDetails extends Google_Model
|
|
6478 |
}
|
6479 |
}
|
6480 |
|
6481 |
-
class
|
6482 |
{
|
6483 |
protected $collection_key = 'items';
|
6484 |
protected $internal_gapi_mappings = array(
|
6485 |
);
|
6486 |
-
protected $itemsType = '
|
6487 |
protected $itemsDataType = 'array';
|
6488 |
public $itemsPerPage;
|
6489 |
public $kind;
|
@@ -6560,24 +6560,24 @@ class Google_Service_Analytics_Filters extends Google_Collection
|
|
6560 |
}
|
6561 |
}
|
6562 |
|
6563 |
-
class
|
6564 |
{
|
6565 |
protected $collection_key = 'rows';
|
6566 |
protected $internal_gapi_mappings = array(
|
6567 |
);
|
6568 |
-
protected $columnHeadersType = '
|
6569 |
protected $columnHeadersDataType = 'array';
|
6570 |
public $containsSampledData;
|
6571 |
-
protected $dataTableType = '
|
6572 |
protected $dataTableDataType = '';
|
6573 |
public $id;
|
6574 |
public $itemsPerPage;
|
6575 |
public $kind;
|
6576 |
public $nextLink;
|
6577 |
public $previousLink;
|
6578 |
-
protected $profileInfoType = '
|
6579 |
protected $profileInfoDataType = '';
|
6580 |
-
protected $queryType = '
|
6581 |
protected $queryDataType = '';
|
6582 |
public $rows;
|
6583 |
public $sampleSize;
|
@@ -6603,7 +6603,7 @@ class Google_Service_Analytics_GaData extends Google_Collection
|
|
6603 |
{
|
6604 |
return $this->containsSampledData;
|
6605 |
}
|
6606 |
-
public function setDataTable(
|
6607 |
{
|
6608 |
$this->dataTable = $dataTable;
|
6609 |
}
|
@@ -6651,7 +6651,7 @@ class Google_Service_Analytics_GaData extends Google_Collection
|
|
6651 |
{
|
6652 |
return $this->previousLink;
|
6653 |
}
|
6654 |
-
public function setProfileInfo(
|
6655 |
{
|
6656 |
$this->profileInfo = $profileInfo;
|
6657 |
}
|
@@ -6659,7 +6659,7 @@ class Google_Service_Analytics_GaData extends Google_Collection
|
|
6659 |
{
|
6660 |
return $this->profileInfo;
|
6661 |
}
|
6662 |
-
public function setQuery(
|
6663 |
{
|
6664 |
$this->query = $query;
|
6665 |
}
|
@@ -6717,7 +6717,7 @@ class Google_Service_Analytics_GaData extends Google_Collection
|
|
6717 |
}
|
6718 |
}
|
6719 |
|
6720 |
-
class
|
6721 |
{
|
6722 |
protected $internal_gapi_mappings = array(
|
6723 |
);
|
@@ -6752,14 +6752,14 @@ class Google_Service_Analytics_GaDataColumnHeaders extends Google_Model
|
|
6752 |
}
|
6753 |
}
|
6754 |
|
6755 |
-
class
|
6756 |
{
|
6757 |
protected $collection_key = 'rows';
|
6758 |
protected $internal_gapi_mappings = array(
|
6759 |
);
|
6760 |
-
protected $colsType = '
|
6761 |
protected $colsDataType = 'array';
|
6762 |
-
protected $rowsType = '
|
6763 |
protected $rowsDataType = 'array';
|
6764 |
|
6765 |
|
@@ -6781,7 +6781,7 @@ class Google_Service_Analytics_GaDataDataTable extends Google_Collection
|
|
6781 |
}
|
6782 |
}
|
6783 |
|
6784 |
-
class
|
6785 |
{
|
6786 |
protected $internal_gapi_mappings = array(
|
6787 |
);
|
@@ -6816,12 +6816,12 @@ class Google_Service_Analytics_GaDataDataTableCols extends Google_Model
|
|
6816 |
}
|
6817 |
}
|
6818 |
|
6819 |
-
class
|
6820 |
{
|
6821 |
protected $collection_key = 'c';
|
6822 |
protected $internal_gapi_mappings = array(
|
6823 |
);
|
6824 |
-
protected $cType = '
|
6825 |
protected $cDataType = 'array';
|
6826 |
|
6827 |
|
@@ -6835,7 +6835,7 @@ class Google_Service_Analytics_GaDataDataTableRows extends Google_Collection
|
|
6835 |
}
|
6836 |
}
|
6837 |
|
6838 |
-
class
|
6839 |
{
|
6840 |
protected $internal_gapi_mappings = array(
|
6841 |
);
|
@@ -6852,7 +6852,7 @@ class Google_Service_Analytics_GaDataDataTableRowsC extends Google_Model
|
|
6852 |
}
|
6853 |
}
|
6854 |
|
6855 |
-
class
|
6856 |
{
|
6857 |
protected $internal_gapi_mappings = array(
|
6858 |
);
|
@@ -6914,7 +6914,7 @@ class Google_Service_Analytics_GaDataProfileInfo extends Google_Model
|
|
6914 |
}
|
6915 |
}
|
6916 |
|
6917 |
-
class
|
6918 |
{
|
6919 |
protected $collection_key = 'sort';
|
6920 |
protected $internal_gapi_mappings = array(
|
@@ -7026,31 +7026,31 @@ class Google_Service_Analytics_GaDataQuery extends Google_Collection
|
|
7026 |
}
|
7027 |
}
|
7028 |
|
7029 |
-
class
|
7030 |
{
|
7031 |
protected $internal_gapi_mappings = array(
|
7032 |
);
|
7033 |
public $accountId;
|
7034 |
public $active;
|
7035 |
public $created;
|
7036 |
-
protected $eventDetailsType = '
|
7037 |
protected $eventDetailsDataType = '';
|
7038 |
public $id;
|
7039 |
public $internalWebPropertyId;
|
7040 |
public $kind;
|
7041 |
public $name;
|
7042 |
-
protected $parentLinkType = '
|
7043 |
protected $parentLinkDataType = '';
|
7044 |
public $profileId;
|
7045 |
public $selfLink;
|
7046 |
public $type;
|
7047 |
public $updated;
|
7048 |
-
protected $urlDestinationDetailsType = '
|
7049 |
protected $urlDestinationDetailsDataType = '';
|
7050 |
public $value;
|
7051 |
-
protected $visitNumPagesDetailsType = '
|
7052 |
protected $visitNumPagesDetailsDataType = '';
|
7053 |
-
protected $visitTimeOnSiteDetailsType = '
|
7054 |
protected $visitTimeOnSiteDetailsDataType = '';
|
7055 |
public $webPropertyId;
|
7056 |
|
@@ -7079,7 +7079,7 @@ class Google_Service_Analytics_Goal extends Google_Model
|
|
7079 |
{
|
7080 |
return $this->created;
|
7081 |
}
|
7082 |
-
public function setEventDetails(
|
7083 |
{
|
7084 |
$this->eventDetails = $eventDetails;
|
7085 |
}
|
@@ -7119,7 +7119,7 @@ class Google_Service_Analytics_Goal extends Google_Model
|
|
7119 |
{
|
7120 |
return $this->name;
|
7121 |
}
|
7122 |
-
public function setParentLink(
|
7123 |
{
|
7124 |
$this->parentLink = $parentLink;
|
7125 |
}
|
@@ -7159,7 +7159,7 @@ class Google_Service_Analytics_Goal extends Google_Model
|
|
7159 |
{
|
7160 |
return $this->updated;
|
7161 |
}
|
7162 |
-
public function setUrlDestinationDetails(
|
7163 |
{
|
7164 |
$this->urlDestinationDetails = $urlDestinationDetails;
|
7165 |
}
|
@@ -7175,7 +7175,7 @@ class Google_Service_Analytics_Goal extends Google_Model
|
|
7175 |
{
|
7176 |
return $this->value;
|
7177 |
}
|
7178 |
-
public function setVisitNumPagesDetails(
|
7179 |
{
|
7180 |
$this->visitNumPagesDetails = $visitNumPagesDetails;
|
7181 |
}
|
@@ -7183,7 +7183,7 @@ class Google_Service_Analytics_Goal extends Google_Model
|
|
7183 |
{
|
7184 |
return $this->visitNumPagesDetails;
|
7185 |
}
|
7186 |
-
public function setVisitTimeOnSiteDetails(
|
7187 |
{
|
7188 |
$this->visitTimeOnSiteDetails = $visitTimeOnSiteDetails;
|
7189 |
}
|
@@ -7201,12 +7201,12 @@ class Google_Service_Analytics_Goal extends Google_Model
|
|
7201 |
}
|
7202 |
}
|
7203 |
|
7204 |
-
class
|
7205 |
{
|
7206 |
protected $collection_key = 'eventConditions';
|
7207 |
protected $internal_gapi_mappings = array(
|
7208 |
);
|
7209 |
-
protected $eventConditionsType = '
|
7210 |
protected $eventConditionsDataType = 'array';
|
7211 |
public $useEventValue;
|
7212 |
|
@@ -7229,7 +7229,7 @@ class Google_Service_Analytics_GoalEventDetails extends Google_Collection
|
|
7229 |
}
|
7230 |
}
|
7231 |
|
7232 |
-
class
|
7233 |
{
|
7234 |
protected $internal_gapi_mappings = array(
|
7235 |
);
|
@@ -7282,7 +7282,7 @@ class Google_Service_Analytics_GoalEventDetailsEventConditions extends Google_Mo
|
|
7282 |
}
|
7283 |
}
|
7284 |
|
7285 |
-
class
|
7286 |
{
|
7287 |
protected $internal_gapi_mappings = array(
|
7288 |
);
|
@@ -7308,7 +7308,7 @@ class Google_Service_Analytics_GoalParentLink extends Google_Model
|
|
7308 |
}
|
7309 |
}
|
7310 |
|
7311 |
-
class
|
7312 |
{
|
7313 |
protected $collection_key = 'steps';
|
7314 |
protected $internal_gapi_mappings = array(
|
@@ -7316,7 +7316,7 @@ class Google_Service_Analytics_GoalUrlDestinationDetails extends Google_Collecti
|
|
7316 |
public $caseSensitive;
|
7317 |
public $firstStepRequired;
|
7318 |
public $matchType;
|
7319 |
-
protected $stepsType = '
|
7320 |
protected $stepsDataType = 'array';
|
7321 |
public $url;
|
7322 |
|
@@ -7363,7 +7363,7 @@ class Google_Service_Analytics_GoalUrlDestinationDetails extends Google_Collecti
|
|
7363 |
}
|
7364 |
}
|
7365 |
|
7366 |
-
class
|
7367 |
{
|
7368 |
protected $internal_gapi_mappings = array(
|
7369 |
);
|
@@ -7398,7 +7398,7 @@ class Google_Service_Analytics_GoalUrlDestinationDetailsSteps extends Google_Mod
|
|
7398 |
}
|
7399 |
}
|
7400 |
|
7401 |
-
class
|
7402 |
{
|
7403 |
protected $internal_gapi_mappings = array(
|
7404 |
);
|
@@ -7424,7 +7424,7 @@ class Google_Service_Analytics_GoalVisitNumPagesDetails extends Google_Model
|
|
7424 |
}
|
7425 |
}
|
7426 |
|
7427 |
-
class
|
7428 |
{
|
7429 |
protected $internal_gapi_mappings = array(
|
7430 |
);
|
@@ -7450,12 +7450,12 @@ class Google_Service_Analytics_GoalVisitTimeOnSiteDetails extends Google_Model
|
|
7450 |
}
|
7451 |
}
|
7452 |
|
7453 |
-
class
|
7454 |
{
|
7455 |
protected $collection_key = 'items';
|
7456 |
protected $internal_gapi_mappings = array(
|
7457 |
);
|
7458 |
-
protected $itemsType = '
|
7459 |
protected $itemsDataType = 'array';
|
7460 |
public $itemsPerPage;
|
7461 |
public $kind;
|
@@ -7532,12 +7532,12 @@ class Google_Service_Analytics_Goals extends Google_Collection
|
|
7532 |
}
|
7533 |
}
|
7534 |
|
7535 |
-
class
|
7536 |
{
|
7537 |
protected $collection_key = 'rows';
|
7538 |
protected $internal_gapi_mappings = array(
|
7539 |
);
|
7540 |
-
protected $columnHeadersType = '
|
7541 |
protected $columnHeadersDataType = 'array';
|
7542 |
public $containsSampledData;
|
7543 |
public $id;
|
@@ -7545,11 +7545,11 @@ class Google_Service_Analytics_McfData extends Google_Collection
|
|
7545 |
public $kind;
|
7546 |
public $nextLink;
|
7547 |
public $previousLink;
|
7548 |
-
protected $profileInfoType = '
|
7549 |
protected $profileInfoDataType = '';
|
7550 |
-
protected $queryType = '
|
7551 |
protected $queryDataType = '';
|
7552 |
-
protected $rowsType = '
|
7553 |
protected $rowsDataType = 'array';
|
7554 |
public $sampleSize;
|
7555 |
public $sampleSpace;
|
@@ -7614,7 +7614,7 @@ class Google_Service_Analytics_McfData extends Google_Collection
|
|
7614 |
{
|
7615 |
return $this->previousLink;
|
7616 |
}
|
7617 |
-
public function setProfileInfo(
|
7618 |
{
|
7619 |
$this->profileInfo = $profileInfo;
|
7620 |
}
|
@@ -7622,7 +7622,7 @@ class Google_Service_Analytics_McfData extends Google_Collection
|
|
7622 |
{
|
7623 |
return $this->profileInfo;
|
7624 |
}
|
7625 |
-
public function setQuery(
|
7626 |
{
|
7627 |
$this->query = $query;
|
7628 |
}
|
@@ -7680,7 +7680,7 @@ class Google_Service_Analytics_McfData extends Google_Collection
|
|
7680 |
}
|
7681 |
}
|
7682 |
|
7683 |
-
class
|
7684 |
{
|
7685 |
protected $internal_gapi_mappings = array(
|
7686 |
);
|
@@ -7715,7 +7715,7 @@ class Google_Service_Analytics_McfDataColumnHeaders extends Google_Model
|
|
7715 |
}
|
7716 |
}
|
7717 |
|
7718 |
-
class
|
7719 |
{
|
7720 |
protected $internal_gapi_mappings = array(
|
7721 |
);
|
@@ -7777,7 +7777,7 @@ class Google_Service_Analytics_McfDataProfileInfo extends Google_Model
|
|
7777 |
}
|
7778 |
}
|
7779 |
|
7780 |
-
class
|
7781 |
{
|
7782 |
protected $collection_key = 'sort';
|
7783 |
protected $internal_gapi_mappings = array(
|
@@ -7889,12 +7889,12 @@ class Google_Service_Analytics_McfDataQuery extends Google_Collection
|
|
7889 |
}
|
7890 |
}
|
7891 |
|
7892 |
-
class
|
7893 |
{
|
7894 |
protected $collection_key = 'conversionPathValue';
|
7895 |
protected $internal_gapi_mappings = array(
|
7896 |
);
|
7897 |
-
protected $conversionPathValueType = '
|
7898 |
protected $conversionPathValueDataType = 'array';
|
7899 |
public $primitiveValue;
|
7900 |
|
@@ -7917,7 +7917,7 @@ class Google_Service_Analytics_McfDataRows extends Google_Collection
|
|
7917 |
}
|
7918 |
}
|
7919 |
|
7920 |
-
class
|
7921 |
{
|
7922 |
protected $internal_gapi_mappings = array(
|
7923 |
);
|
@@ -7943,13 +7943,13 @@ class Google_Service_Analytics_McfDataRowsConversionPathValue extends Google_Mod
|
|
7943 |
}
|
7944 |
}
|
7945 |
|
7946 |
-
class
|
7947 |
{
|
7948 |
protected $internal_gapi_mappings = array(
|
7949 |
);
|
7950 |
public $accountId;
|
7951 |
public $botFilteringEnabled;
|
7952 |
-
protected $childLinkType = '
|
7953 |
protected $childLinkDataType = '';
|
7954 |
public $created;
|
7955 |
public $currency;
|
@@ -7961,9 +7961,9 @@ class Google_Service_Analytics_Profile extends Google_Model
|
|
7961 |
public $internalWebPropertyId;
|
7962 |
public $kind;
|
7963 |
public $name;
|
7964 |
-
protected $parentLinkType = '
|
7965 |
protected $parentLinkDataType = '';
|
7966 |
-
protected $permissionsType = '
|
7967 |
protected $permissionsDataType = '';
|
7968 |
public $selfLink;
|
7969 |
public $siteSearchCategoryParameters;
|
@@ -7993,7 +7993,7 @@ class Google_Service_Analytics_Profile extends Google_Model
|
|
7993 |
{
|
7994 |
return $this->botFilteringEnabled;
|
7995 |
}
|
7996 |
-
public function setChildLink(
|
7997 |
{
|
7998 |
$this->childLink = $childLink;
|
7999 |
}
|
@@ -8081,7 +8081,7 @@ class Google_Service_Analytics_Profile extends Google_Model
|
|
8081 |
{
|
8082 |
return $this->name;
|
8083 |
}
|
8084 |
-
public function setParentLink(
|
8085 |
{
|
8086 |
$this->parentLink = $parentLink;
|
8087 |
}
|
@@ -8089,7 +8089,7 @@ class Google_Service_Analytics_Profile extends Google_Model
|
|
8089 |
{
|
8090 |
return $this->parentLink;
|
8091 |
}
|
8092 |
-
public function setPermissions(
|
8093 |
{
|
8094 |
$this->permissions = $permissions;
|
8095 |
}
|
@@ -8179,7 +8179,7 @@ class Google_Service_Analytics_Profile extends Google_Model
|
|
8179 |
}
|
8180 |
}
|
8181 |
|
8182 |
-
class
|
8183 |
{
|
8184 |
protected $internal_gapi_mappings = array(
|
8185 |
);
|
@@ -8205,21 +8205,21 @@ class Google_Service_Analytics_ProfileChildLink extends Google_Model
|
|
8205 |
}
|
8206 |
}
|
8207 |
|
8208 |
-
class
|
8209 |
{
|
8210 |
protected $internal_gapi_mappings = array(
|
8211 |
);
|
8212 |
-
protected $filterRefType = '
|
8213 |
protected $filterRefDataType = '';
|
8214 |
public $id;
|
8215 |
public $kind;
|
8216 |
-
protected $profileRefType = '
|
8217 |
protected $profileRefDataType = '';
|
8218 |
public $rank;
|
8219 |
public $selfLink;
|
8220 |
|
8221 |
|
8222 |
-
public function setFilterRef(
|
8223 |
{
|
8224 |
$this->filterRef = $filterRef;
|
8225 |
}
|
@@ -8243,7 +8243,7 @@ class Google_Service_Analytics_ProfileFilterLink extends Google_Model
|
|
8243 |
{
|
8244 |
return $this->kind;
|
8245 |
}
|
8246 |
-
public function setProfileRef(
|
8247 |
{
|
8248 |
$this->profileRef = $profileRef;
|
8249 |
}
|
@@ -8269,12 +8269,12 @@ class Google_Service_Analytics_ProfileFilterLink extends Google_Model
|
|
8269 |
}
|
8270 |
}
|
8271 |
|
8272 |
-
class
|
8273 |
{
|
8274 |
protected $collection_key = 'items';
|
8275 |
protected $internal_gapi_mappings = array(
|
8276 |
);
|
8277 |
-
protected $itemsType = '
|
8278 |
protected $itemsDataType = 'array';
|
8279 |
public $itemsPerPage;
|
8280 |
public $kind;
|
@@ -8351,7 +8351,7 @@ class Google_Service_Analytics_ProfileFilterLinks extends Google_Collection
|
|
8351 |
}
|
8352 |
}
|
8353 |
|
8354 |
-
class
|
8355 |
{
|
8356 |
protected $internal_gapi_mappings = array(
|
8357 |
);
|
@@ -8377,7 +8377,7 @@ class Google_Service_Analytics_ProfileParentLink extends Google_Model
|
|
8377 |
}
|
8378 |
}
|
8379 |
|
8380 |
-
class
|
8381 |
{
|
8382 |
protected $collection_key = 'effective';
|
8383 |
protected $internal_gapi_mappings = array(
|
@@ -8395,7 +8395,7 @@ class Google_Service_Analytics_ProfilePermissions extends Google_Collection
|
|
8395 |
}
|
8396 |
}
|
8397 |
|
8398 |
-
class
|
8399 |
{
|
8400 |
protected $internal_gapi_mappings = array(
|
8401 |
);
|
@@ -8466,7 +8466,7 @@ class Google_Service_Analytics_ProfileRef extends Google_Model
|
|
8466 |
}
|
8467 |
}
|
8468 |
|
8469 |
-
class
|
8470 |
{
|
8471 |
protected $internal_gapi_mappings = array(
|
8472 |
);
|
@@ -8510,12 +8510,12 @@ class Google_Service_Analytics_ProfileSummary extends Google_Model
|
|
8510 |
}
|
8511 |
}
|
8512 |
|
8513 |
-
class
|
8514 |
{
|
8515 |
protected $collection_key = 'items';
|
8516 |
protected $internal_gapi_mappings = array(
|
8517 |
);
|
8518 |
-
protected $itemsType = '
|
8519 |
protected $itemsDataType = 'array';
|
8520 |
public $itemsPerPage;
|
8521 |
public $kind;
|
@@ -8592,18 +8592,18 @@ class Google_Service_Analytics_Profiles extends Google_Collection
|
|
8592 |
}
|
8593 |
}
|
8594 |
|
8595 |
-
class
|
8596 |
{
|
8597 |
protected $collection_key = 'rows';
|
8598 |
protected $internal_gapi_mappings = array(
|
8599 |
);
|
8600 |
-
protected $columnHeadersType = '
|
8601 |
protected $columnHeadersDataType = 'array';
|
8602 |
public $id;
|
8603 |
public $kind;
|
8604 |
-
protected $profileInfoType = '
|
8605 |
protected $profileInfoDataType = '';
|
8606 |
-
protected $queryType = '
|
8607 |
protected $queryDataType = '';
|
8608 |
public $rows;
|
8609 |
public $selfLink;
|
@@ -8635,7 +8635,7 @@ class Google_Service_Analytics_RealtimeData extends Google_Collection
|
|
8635 |
{
|
8636 |
return $this->kind;
|
8637 |
}
|
8638 |
-
public function setProfileInfo(
|
8639 |
{
|
8640 |
$this->profileInfo = $profileInfo;
|
8641 |
}
|
@@ -8643,7 +8643,7 @@ class Google_Service_Analytics_RealtimeData extends Google_Collection
|
|
8643 |
{
|
8644 |
return $this->profileInfo;
|
8645 |
}
|
8646 |
-
public function setQuery(
|
8647 |
{
|
8648 |
$this->query = $query;
|
8649 |
}
|
@@ -8685,7 +8685,7 @@ class Google_Service_Analytics_RealtimeData extends Google_Collection
|
|
8685 |
}
|
8686 |
}
|
8687 |
|
8688 |
-
class
|
8689 |
{
|
8690 |
protected $internal_gapi_mappings = array(
|
8691 |
);
|
@@ -8720,7 +8720,7 @@ class Google_Service_Analytics_RealtimeDataColumnHeaders extends Google_Model
|
|
8720 |
}
|
8721 |
}
|
8722 |
|
8723 |
-
class
|
8724 |
{
|
8725 |
protected $internal_gapi_mappings = array(
|
8726 |
);
|
@@ -8782,7 +8782,7 @@ class Google_Service_Analytics_RealtimeDataProfileInfo extends Google_Model
|
|
8782 |
}
|
8783 |
}
|
8784 |
|
8785 |
-
class
|
8786 |
{
|
8787 |
protected $collection_key = 'sort';
|
8788 |
protected $internal_gapi_mappings = array(
|
@@ -8846,7 +8846,7 @@ class Google_Service_Analytics_RealtimeDataQuery extends Google_Collection
|
|
8846 |
}
|
8847 |
}
|
8848 |
|
8849 |
-
class
|
8850 |
{
|
8851 |
protected $internal_gapi_mappings = array(
|
8852 |
);
|
@@ -8935,12 +8935,12 @@ class Google_Service_Analytics_Segment extends Google_Model
|
|
8935 |
}
|
8936 |
}
|
8937 |
|
8938 |
-
class
|
8939 |
{
|
8940 |
protected $collection_key = 'items';
|
8941 |
protected $internal_gapi_mappings = array(
|
8942 |
);
|
8943 |
-
protected $itemsType = '
|
8944 |
protected $itemsDataType = 'array';
|
8945 |
public $itemsPerPage;
|
8946 |
public $kind;
|
@@ -9017,19 +9017,19 @@ class Google_Service_Analytics_Segments extends Google_Collection
|
|
9017 |
}
|
9018 |
}
|
9019 |
|
9020 |
-
class
|
9021 |
{
|
9022 |
protected $internal_gapi_mappings = array(
|
9023 |
"endDate" => "end-date",
|
9024 |
"startDate" => "start-date",
|
9025 |
);
|
9026 |
public $accountId;
|
9027 |
-
protected $cloudStorageDownloadDetailsType = '
|
9028 |
protected $cloudStorageDownloadDetailsDataType = '';
|
9029 |
public $created;
|
9030 |
public $dimensions;
|
9031 |
public $downloadType;
|
9032 |
-
protected $driveDownloadDetailsType = '
|
9033 |
protected $driveDownloadDetailsDataType = '';
|
9034 |
public $endDate;
|
9035 |
public $filters;
|
@@ -9054,7 +9054,7 @@ class Google_Service_Analytics_UnsampledReport extends Google_Model
|
|
9054 |
{
|
9055 |
return $this->accountId;
|
9056 |
}
|
9057 |
-
public function setCloudStorageDownloadDetails(
|
9058 |
{
|
9059 |
$this->cloudStorageDownloadDetails = $cloudStorageDownloadDetails;
|
9060 |
}
|
@@ -9086,7 +9086,7 @@ class Google_Service_Analytics_UnsampledReport extends Google_Model
|
|
9086 |
{
|
9087 |
return $this->downloadType;
|
9088 |
}
|
9089 |
-
public function setDriveDownloadDetails(
|
9090 |
{
|
9091 |
$this->driveDownloadDetails = $driveDownloadDetails;
|
9092 |
}
|
@@ -9200,7 +9200,7 @@ class Google_Service_Analytics_UnsampledReport extends Google_Model
|
|
9200 |
}
|
9201 |
}
|
9202 |
|
9203 |
-
class
|
9204 |
{
|
9205 |
protected $internal_gapi_mappings = array(
|
9206 |
);
|
@@ -9226,7 +9226,7 @@ class Google_Service_Analytics_UnsampledReportCloudStorageDownloadDetails extend
|
|
9226 |
}
|
9227 |
}
|
9228 |
|
9229 |
-
class
|
9230 |
{
|
9231 |
protected $internal_gapi_mappings = array(
|
9232 |
);
|
@@ -9243,12 +9243,12 @@ class Google_Service_Analytics_UnsampledReportDriveDownloadDetails extends Googl
|
|
9243 |
}
|
9244 |
}
|
9245 |
|
9246 |
-
class
|
9247 |
{
|
9248 |
protected $collection_key = 'items';
|
9249 |
protected $internal_gapi_mappings = array(
|
9250 |
);
|
9251 |
-
protected $itemsType = '
|
9252 |
protected $itemsDataType = 'array';
|
9253 |
public $itemsPerPage;
|
9254 |
public $kind;
|
@@ -9325,7 +9325,7 @@ class Google_Service_Analytics_UnsampledReports extends Google_Collection
|
|
9325 |
}
|
9326 |
}
|
9327 |
|
9328 |
-
class
|
9329 |
{
|
9330 |
protected $collection_key = 'errors';
|
9331 |
protected $internal_gapi_mappings = array(
|
@@ -9388,12 +9388,12 @@ class Google_Service_Analytics_Upload extends Google_Collection
|
|
9388 |
}
|
9389 |
}
|
9390 |
|
9391 |
-
class
|
9392 |
{
|
9393 |
protected $collection_key = 'items';
|
9394 |
protected $internal_gapi_mappings = array(
|
9395 |
);
|
9396 |
-
protected $itemsType = '
|
9397 |
protected $itemsDataType = 'array';
|
9398 |
public $itemsPerPage;
|
9399 |
public $kind;
|
@@ -9461,7 +9461,7 @@ class Google_Service_Analytics_Uploads extends Google_Collection
|
|
9461 |
}
|
9462 |
}
|
9463 |
|
9464 |
-
class
|
9465 |
{
|
9466 |
protected $internal_gapi_mappings = array(
|
9467 |
);
|
@@ -9496,7 +9496,7 @@ class Google_Service_Analytics_UserRef extends Google_Model
|
|
9496 |
}
|
9497 |
}
|
9498 |
|
9499 |
-
class
|
9500 |
{
|
9501 |
protected $internal_gapi_mappings = array(
|
9502 |
);
|
@@ -9558,7 +9558,7 @@ class Google_Service_Analytics_WebPropertyRef extends Google_Model
|
|
9558 |
}
|
9559 |
}
|
9560 |
|
9561 |
-
class
|
9562 |
{
|
9563 |
protected $collection_key = 'profiles';
|
9564 |
protected $internal_gapi_mappings = array(
|
@@ -9568,7 +9568,7 @@ class Google_Service_Analytics_WebPropertySummary extends Google_Collection
|
|
9568 |
public $kind;
|
9569 |
public $level;
|
9570 |
public $name;
|
9571 |
-
protected $profilesType = '
|
9572 |
protected $profilesDataType = 'array';
|
9573 |
public $websiteUrl;
|
9574 |
|
@@ -9631,12 +9631,12 @@ class Google_Service_Analytics_WebPropertySummary extends Google_Collection
|
|
9631 |
}
|
9632 |
}
|
9633 |
|
9634 |
-
class
|
9635 |
{
|
9636 |
protected $collection_key = 'items';
|
9637 |
protected $internal_gapi_mappings = array(
|
9638 |
);
|
9639 |
-
protected $itemsType = '
|
9640 |
protected $itemsDataType = 'array';
|
9641 |
public $itemsPerPage;
|
9642 |
public $kind;
|
@@ -9713,12 +9713,12 @@ class Google_Service_Analytics_Webproperties extends Google_Collection
|
|
9713 |
}
|
9714 |
}
|
9715 |
|
9716 |
-
class
|
9717 |
{
|
9718 |
protected $internal_gapi_mappings = array(
|
9719 |
);
|
9720 |
public $accountId;
|
9721 |
-
protected $childLinkType = '
|
9722 |
protected $childLinkDataType = '';
|
9723 |
public $created;
|
9724 |
public $defaultProfileId;
|
@@ -9728,9 +9728,9 @@ class Google_Service_Analytics_Webproperty extends Google_Model
|
|
9728 |
public $kind;
|
9729 |
public $level;
|
9730 |
public $name;
|
9731 |
-
protected $parentLinkType = '
|
9732 |
protected $parentLinkDataType = '';
|
9733 |
-
protected $permissionsType = '
|
9734 |
protected $permissionsDataType = '';
|
9735 |
public $profileCount;
|
9736 |
public $selfLink;
|
@@ -9746,7 +9746,7 @@ class Google_Service_Analytics_Webproperty extends Google_Model
|
|
9746 |
{
|
9747 |
return $this->accountId;
|
9748 |
}
|
9749 |
-
public function setChildLink(
|
9750 |
{
|
9751 |
$this->childLink = $childLink;
|
9752 |
}
|
@@ -9818,7 +9818,7 @@ class Google_Service_Analytics_Webproperty extends Google_Model
|
|
9818 |
{
|
9819 |
return $this->name;
|
9820 |
}
|
9821 |
-
public function setParentLink(
|
9822 |
{
|
9823 |
$this->parentLink = $parentLink;
|
9824 |
}
|
@@ -9826,7 +9826,7 @@ class Google_Service_Analytics_Webproperty extends Google_Model
|
|
9826 |
{
|
9827 |
return $this->parentLink;
|
9828 |
}
|
9829 |
-
public function setPermissions(
|
9830 |
{
|
9831 |
$this->permissions = $permissions;
|
9832 |
}
|
@@ -9868,7 +9868,7 @@ class Google_Service_Analytics_Webproperty extends Google_Model
|
|
9868 |
}
|
9869 |
}
|
9870 |
|
9871 |
-
class
|
9872 |
{
|
9873 |
protected $internal_gapi_mappings = array(
|
9874 |
);
|
@@ -9894,7 +9894,7 @@ class Google_Service_Analytics_WebpropertyChildLink extends Google_Model
|
|
9894 |
}
|
9895 |
}
|
9896 |
|
9897 |
-
class
|
9898 |
{
|
9899 |
protected $internal_gapi_mappings = array(
|
9900 |
);
|
@@ -9920,7 +9920,7 @@ class Google_Service_Analytics_WebpropertyParentLink extends Google_Model
|
|
9920 |
}
|
9921 |
}
|
9922 |
|
9923 |
-
class
|
9924 |
{
|
9925 |
protected $collection_key = 'effective';
|
9926 |
protected $internal_gapi_mappings = array(
|
26 |
*
|
27 |
* @author Google, Inc.
|
28 |
*/
|
29 |
+
class Deconf_Service_Analytics extends Deconf_Service
|
30 |
{
|
31 |
/** View and manage your Google Analytics data. */
|
32 |
const ANALYTICS =
|
75 |
/**
|
76 |
* Constructs the internal representation of the Analytics service.
|
77 |
*
|
78 |
+
* @param Deconf_Client $client
|
79 |
*/
|
80 |
+
public function __construct(Deconf_Client $client)
|
81 |
{
|
82 |
parent::__construct($client);
|
83 |
$this->rootUrl = 'https://www.googleapis.com/';
|
85 |
$this->version = 'v3';
|
86 |
$this->serviceName = 'analytics';
|
87 |
|
88 |
+
$this->data_ga = new Deconf_Service_Analytics_DataGa_Resource(
|
89 |
$this,
|
90 |
$this->serviceName,
|
91 |
'ga',
|
156 |
)
|
157 |
)
|
158 |
);
|
159 |
+
$this->data_mcf = new Deconf_Service_Analytics_DataMcf_Resource(
|
160 |
$this,
|
161 |
$this->serviceName,
|
162 |
'mcf',
|
215 |
)
|
216 |
)
|
217 |
);
|
218 |
+
$this->data_realtime = new Deconf_Service_Analytics_DataRealtime_Resource(
|
219 |
$this,
|
220 |
$this->serviceName,
|
221 |
'realtime',
|
256 |
)
|
257 |
)
|
258 |
);
|
259 |
+
$this->management_accountSummaries = new Deconf_Service_Analytics_ManagementAccountSummaries_Resource(
|
260 |
$this,
|
261 |
$this->serviceName,
|
262 |
'accountSummaries',
|
279 |
)
|
280 |
)
|
281 |
);
|
282 |
+
$this->management_accountUserLinks = new Deconf_Service_Analytics_ManagementAccountUserLinks_Resource(
|
283 |
$this,
|
284 |
$this->serviceName,
|
285 |
'accountUserLinks',
|
347 |
)
|
348 |
)
|
349 |
);
|
350 |
+
$this->management_accounts = new Deconf_Service_Analytics_ManagementAccounts_Resource(
|
351 |
$this,
|
352 |
$this->serviceName,
|
353 |
'accounts',
|
370 |
)
|
371 |
)
|
372 |
);
|
373 |
+
$this->management_customDataSources = new Deconf_Service_Analytics_ManagementCustomDataSources_Resource(
|
374 |
$this,
|
375 |
$this->serviceName,
|
376 |
'customDataSources',
|
403 |
)
|
404 |
)
|
405 |
);
|
406 |
+
$this->management_customDimensions = new Deconf_Service_Analytics_ManagementCustomDimensions_Resource(
|
407 |
$this,
|
408 |
$this->serviceName,
|
409 |
'customDimensions',
|
519 |
)
|
520 |
)
|
521 |
);
|
522 |
+
$this->management_customMetrics = new Deconf_Service_Analytics_ManagementCustomMetrics_Resource(
|
523 |
$this,
|
524 |
$this->serviceName,
|
525 |
'customMetrics',
|
635 |
)
|
636 |
)
|
637 |
);
|
638 |
+
$this->management_experiments = new Deconf_Service_Analytics_ManagementExperiments_Resource(
|
639 |
$this,
|
640 |
$this->serviceName,
|
641 |
'experiments',
|
793 |
)
|
794 |
)
|
795 |
);
|
796 |
+
$this->management_filters = new Deconf_Service_Analytics_ManagementFilters_Resource(
|
797 |
$this,
|
798 |
$this->serviceName,
|
799 |
'filters',
|
891 |
)
|
892 |
)
|
893 |
);
|
894 |
+
$this->management_goals = new Deconf_Service_Analytics_ManagementGoals_Resource(
|
895 |
$this,
|
896 |
$this->serviceName,
|
897 |
'goals',
|
1024 |
)
|
1025 |
)
|
1026 |
);
|
1027 |
+
$this->management_profileFilterLinks = new Deconf_Service_Analytics_ManagementProfileFilterLinks_Resource(
|
1028 |
$this,
|
1029 |
$this->serviceName,
|
1030 |
'profileFilterLinks',
|
1182 |
)
|
1183 |
)
|
1184 |
);
|
1185 |
+
$this->management_profileUserLinks = new Deconf_Service_Analytics_ManagementProfileUserLinks_Resource(
|
1186 |
$this,
|
1187 |
$this->serviceName,
|
1188 |
'profileUserLinks',
|
1290 |
)
|
1291 |
)
|
1292 |
);
|
1293 |
+
$this->management_profiles = new Deconf_Service_Analytics_ManagementProfiles_Resource(
|
1294 |
$this,
|
1295 |
$this->serviceName,
|
1296 |
'profiles',
|
1418 |
)
|
1419 |
)
|
1420 |
);
|
1421 |
+
$this->management_segments = new Deconf_Service_Analytics_ManagementSegments_Resource(
|
1422 |
$this,
|
1423 |
$this->serviceName,
|
1424 |
'segments',
|
1441 |
)
|
1442 |
)
|
1443 |
);
|
1444 |
+
$this->management_unsampledReports = new Deconf_Service_Analytics_ManagementUnsampledReports_Resource(
|
1445 |
$this,
|
1446 |
$this->serviceName,
|
1447 |
'unsampledReports',
|
1549 |
)
|
1550 |
)
|
1551 |
);
|
1552 |
+
$this->management_uploads = new Deconf_Service_Analytics_ManagementUploads_Resource(
|
1553 |
$this,
|
1554 |
$this->serviceName,
|
1555 |
'uploads',
|
1652 |
)
|
1653 |
)
|
1654 |
);
|
1655 |
+
$this->management_webPropertyAdWordsLinks = new Deconf_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource(
|
1656 |
$this,
|
1657 |
$this->serviceName,
|
1658 |
'webPropertyAdWordsLinks',
|
1780 |
)
|
1781 |
)
|
1782 |
);
|
1783 |
+
$this->management_webproperties = new Deconf_Service_Analytics_ManagementWebproperties_Resource(
|
1784 |
$this,
|
1785 |
$this->serviceName,
|
1786 |
'webproperties',
|
1863 |
)
|
1864 |
)
|
1865 |
);
|
1866 |
+
$this->management_webpropertyUserLinks = new Deconf_Service_Analytics_ManagementWebpropertyUserLinks_Resource(
|
1867 |
$this,
|
1868 |
$this->serviceName,
|
1869 |
'webpropertyUserLinks',
|
1951 |
)
|
1952 |
)
|
1953 |
);
|
1954 |
+
$this->metadata_columns = new Deconf_Service_Analytics_MetadataColumns_Resource(
|
1955 |
$this,
|
1956 |
$this->serviceName,
|
1957 |
'columns',
|
1971 |
)
|
1972 |
)
|
1973 |
);
|
1974 |
+
$this->provisioning = new Deconf_Service_Analytics_Provisioning_Resource(
|
1975 |
$this,
|
1976 |
$this->serviceName,
|
1977 |
'provisioning',
|
1993 |
* The "data" collection of methods.
|
1994 |
* Typical usage is:
|
1995 |
* <code>
|
1996 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
1997 |
* $data = $analyticsService->data;
|
1998 |
* </code>
|
1999 |
*/
|
2000 |
+
class Deconf_Service_Analytics_Data_Resource extends Deconf_Service_Resource
|
2001 |
{
|
2002 |
}
|
2003 |
|
2005 |
* The "ga" collection of methods.
|
2006 |
* Typical usage is:
|
2007 |
* <code>
|
2008 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2009 |
* $ga = $analyticsService->ga;
|
2010 |
* </code>
|
2011 |
*/
|
2012 |
+
class Deconf_Service_Analytics_DataGa_Resource extends Deconf_Service_Resource
|
2013 |
{
|
2014 |
|
2015 |
/**
|
2043 |
* determine the sort order for Analytics data.
|
2044 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2045 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2046 |
+
* @return Deconf_Service_Analytics_GaData
|
2047 |
*/
|
2048 |
public function get($ids, $startDate, $endDate, $metrics, $optParams = array())
|
2049 |
{
|
2050 |
$params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics);
|
2051 |
$params = array_merge($params, $optParams);
|
2052 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_GaData");
|
2053 |
}
|
2054 |
}
|
2055 |
/**
|
2056 |
* The "mcf" collection of methods.
|
2057 |
* Typical usage is:
|
2058 |
* <code>
|
2059 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2060 |
* $mcf = $analyticsService->mcf;
|
2061 |
* </code>
|
2062 |
*/
|
2063 |
+
class Deconf_Service_Analytics_DataMcf_Resource extends Deconf_Service_Resource
|
2064 |
{
|
2065 |
|
2066 |
/**
|
2090 |
* determine the sort order for the Analytics data.
|
2091 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2092 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2093 |
+
* @return Deconf_Service_Analytics_McfData
|
2094 |
*/
|
2095 |
public function get($ids, $startDate, $endDate, $metrics, $optParams = array())
|
2096 |
{
|
2097 |
$params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics);
|
2098 |
$params = array_merge($params, $optParams);
|
2099 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_McfData");
|
2100 |
}
|
2101 |
}
|
2102 |
/**
|
2103 |
* The "realtime" collection of methods.
|
2104 |
* Typical usage is:
|
2105 |
* <code>
|
2106 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2107 |
* $realtime = $analyticsService->realtime;
|
2108 |
* </code>
|
2109 |
*/
|
2110 |
+
class Deconf_Service_Analytics_DataRealtime_Resource extends Deconf_Service_Resource
|
2111 |
{
|
2112 |
|
2113 |
/**
|
2127 |
* feed.
|
2128 |
* @opt_param string sort A comma-separated list of dimensions or metrics that
|
2129 |
* determine the sort order for real time data.
|
2130 |
+
* @return Deconf_Service_Analytics_RealtimeData
|
2131 |
*/
|
2132 |
public function get($ids, $metrics, $optParams = array())
|
2133 |
{
|
2134 |
$params = array('ids' => $ids, 'metrics' => $metrics);
|
2135 |
$params = array_merge($params, $optParams);
|
2136 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_RealtimeData");
|
2137 |
}
|
2138 |
}
|
2139 |
|
2141 |
* The "management" collection of methods.
|
2142 |
* Typical usage is:
|
2143 |
* <code>
|
2144 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2145 |
* $management = $analyticsService->management;
|
2146 |
* </code>
|
2147 |
*/
|
2148 |
+
class Deconf_Service_Analytics_Management_Resource extends Deconf_Service_Resource
|
2149 |
{
|
2150 |
}
|
2151 |
|
2153 |
* The "accountSummaries" collection of methods.
|
2154 |
* Typical usage is:
|
2155 |
* <code>
|
2156 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2157 |
* $accountSummaries = $analyticsService->accountSummaries;
|
2158 |
* </code>
|
2159 |
*/
|
2160 |
+
class Deconf_Service_Analytics_ManagementAccountSummaries_Resource extends Deconf_Service_Resource
|
2161 |
{
|
2162 |
|
2163 |
/**
|
2171 |
* in this response, where the largest acceptable value is 1000.
|
2172 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2173 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2174 |
+
* @return Deconf_Service_Analytics_AccountSummaries
|
2175 |
*/
|
2176 |
public function listManagementAccountSummaries($optParams = array())
|
2177 |
{
|
2178 |
$params = array();
|
2179 |
$params = array_merge($params, $optParams);
|
2180 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_AccountSummaries");
|
2181 |
}
|
2182 |
}
|
2183 |
/**
|
2184 |
* The "accountUserLinks" collection of methods.
|
2185 |
* Typical usage is:
|
2186 |
* <code>
|
2187 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2188 |
* $accountUserLinks = $analyticsService->accountUserLinks;
|
2189 |
* </code>
|
2190 |
*/
|
2191 |
+
class Deconf_Service_Analytics_ManagementAccountUserLinks_Resource extends Deconf_Service_Resource
|
2192 |
{
|
2193 |
|
2194 |
/**
|
2209 |
* Adds a new user to the given account. (accountUserLinks.insert)
|
2210 |
*
|
2211 |
* @param string $accountId Account ID to create the user link for.
|
2212 |
+
* @param Deconf_EntityUserLink $postBody
|
2213 |
* @param array $optParams Optional parameters.
|
2214 |
+
* @return Deconf_Service_Analytics_EntityUserLink
|
2215 |
*/
|
2216 |
+
public function insert($accountId, Deconf_Service_Analytics_EntityUserLink $postBody, $optParams = array())
|
2217 |
{
|
2218 |
$params = array('accountId' => $accountId, 'postBody' => $postBody);
|
2219 |
$params = array_merge($params, $optParams);
|
2220 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_EntityUserLink");
|
2221 |
}
|
2222 |
|
2223 |
/**
|
2232 |
* @opt_param int start-index An index of the first account-user link to
|
2233 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
2234 |
* results parameter.
|
2235 |
+
* @return Deconf_Service_Analytics_EntityUserLinks
|
2236 |
*/
|
2237 |
public function listManagementAccountUserLinks($accountId, $optParams = array())
|
2238 |
{
|
2239 |
$params = array('accountId' => $accountId);
|
2240 |
$params = array_merge($params, $optParams);
|
2241 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_EntityUserLinks");
|
2242 |
}
|
2243 |
|
2244 |
/**
|
2247 |
*
|
2248 |
* @param string $accountId Account ID to update the account-user link for.
|
2249 |
* @param string $linkId Link ID to update the account-user link for.
|
2250 |
+
* @param Deconf_EntityUserLink $postBody
|
2251 |
* @param array $optParams Optional parameters.
|
2252 |
+
* @return Deconf_Service_Analytics_EntityUserLink
|
2253 |
*/
|
2254 |
+
public function update($accountId, $linkId, Deconf_Service_Analytics_EntityUserLink $postBody, $optParams = array())
|
2255 |
{
|
2256 |
$params = array('accountId' => $accountId, 'linkId' => $linkId, 'postBody' => $postBody);
|
2257 |
$params = array_merge($params, $optParams);
|
2258 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_EntityUserLink");
|
2259 |
}
|
2260 |
}
|
2261 |
/**
|
2262 |
* The "accounts" collection of methods.
|
2263 |
* Typical usage is:
|
2264 |
* <code>
|
2265 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2266 |
* $accounts = $analyticsService->accounts;
|
2267 |
* </code>
|
2268 |
*/
|
2269 |
+
class Deconf_Service_Analytics_ManagementAccounts_Resource extends Deconf_Service_Resource
|
2270 |
{
|
2271 |
|
2272 |
/**
|
2280 |
* @opt_param int start-index An index of the first account to retrieve. Use
|
2281 |
* this parameter as a pagination mechanism along with the max-results
|
2282 |
* parameter.
|
2283 |
+
* @return Deconf_Service_Analytics_Accounts
|
2284 |
*/
|
2285 |
public function listManagementAccounts($optParams = array())
|
2286 |
{
|
2287 |
$params = array();
|
2288 |
$params = array_merge($params, $optParams);
|
2289 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Accounts");
|
2290 |
}
|
2291 |
}
|
2292 |
/**
|
2293 |
* The "customDataSources" collection of methods.
|
2294 |
* Typical usage is:
|
2295 |
* <code>
|
2296 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2297 |
* $customDataSources = $analyticsService->customDataSources;
|
2298 |
* </code>
|
2299 |
*/
|
2300 |
+
class Deconf_Service_Analytics_ManagementCustomDataSources_Resource extends Deconf_Service_Resource
|
2301 |
{
|
2302 |
|
2303 |
/**
|
2314 |
* @opt_param int start-index A 1-based index of the first custom data source to
|
2315 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
2316 |
* results parameter.
|
2317 |
+
* @return Deconf_Service_Analytics_CustomDataSources
|
2318 |
*/
|
2319 |
public function listManagementCustomDataSources($accountId, $webPropertyId, $optParams = array())
|
2320 |
{
|
2321 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
2322 |
$params = array_merge($params, $optParams);
|
2323 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_CustomDataSources");
|
2324 |
}
|
2325 |
}
|
2326 |
/**
|
2327 |
* The "customDimensions" collection of methods.
|
2328 |
* Typical usage is:
|
2329 |
* <code>
|
2330 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2331 |
* $customDimensions = $analyticsService->customDimensions;
|
2332 |
* </code>
|
2333 |
*/
|
2334 |
+
class Deconf_Service_Analytics_ManagementCustomDimensions_Resource extends Deconf_Service_Resource
|
2335 |
{
|
2336 |
|
2337 |
/**
|
2342 |
* retrieve.
|
2343 |
* @param string $customDimensionId The ID of the custom dimension to retrieve.
|
2344 |
* @param array $optParams Optional parameters.
|
2345 |
+
* @return Deconf_Service_Analytics_CustomDimension
|
2346 |
*/
|
2347 |
public function get($accountId, $webPropertyId, $customDimensionId, $optParams = array())
|
2348 |
{
|
2349 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId);
|
2350 |
$params = array_merge($params, $optParams);
|
2351 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_CustomDimension");
|
2352 |
}
|
2353 |
|
2354 |
/**
|
2357 |
* @param string $accountId Account ID for the custom dimension to create.
|
2358 |
* @param string $webPropertyId Web property ID for the custom dimension to
|
2359 |
* create.
|
2360 |
+
* @param Deconf_CustomDimension $postBody
|
2361 |
* @param array $optParams Optional parameters.
|
2362 |
+
* @return Deconf_Service_Analytics_CustomDimension
|
2363 |
*/
|
2364 |
+
public function insert($accountId, $webPropertyId, Deconf_Service_Analytics_CustomDimension $postBody, $optParams = array())
|
2365 |
{
|
2366 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
2367 |
$params = array_merge($params, $optParams);
|
2368 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_CustomDimension");
|
2369 |
}
|
2370 |
|
2371 |
/**
|
2381 |
* in this response.
|
2382 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2383 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2384 |
+
* @return Deconf_Service_Analytics_CustomDimensions
|
2385 |
*/
|
2386 |
public function listManagementCustomDimensions($accountId, $webPropertyId, $optParams = array())
|
2387 |
{
|
2388 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
2389 |
$params = array_merge($params, $optParams);
|
2390 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_CustomDimensions");
|
2391 |
}
|
2392 |
|
2393 |
/**
|
2399 |
* update.
|
2400 |
* @param string $customDimensionId Custom dimension ID for the custom dimension
|
2401 |
* to update.
|
2402 |
+
* @param Deconf_CustomDimension $postBody
|
2403 |
* @param array $optParams Optional parameters.
|
2404 |
*
|
2405 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2406 |
* warnings related to the custom dimension being linked to a custom data source
|
2407 |
* / data set.
|
2408 |
+
* @return Deconf_Service_Analytics_CustomDimension
|
2409 |
*/
|
2410 |
+
public function patch($accountId, $webPropertyId, $customDimensionId, Deconf_Service_Analytics_CustomDimension $postBody, $optParams = array())
|
2411 |
{
|
2412 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId, 'postBody' => $postBody);
|
2413 |
$params = array_merge($params, $optParams);
|
2414 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_CustomDimension");
|
2415 |
}
|
2416 |
|
2417 |
/**
|
2422 |
* update.
|
2423 |
* @param string $customDimensionId Custom dimension ID for the custom dimension
|
2424 |
* to update.
|
2425 |
+
* @param Deconf_CustomDimension $postBody
|
2426 |
* @param array $optParams Optional parameters.
|
2427 |
*
|
2428 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2429 |
* warnings related to the custom dimension being linked to a custom data source
|
2430 |
* / data set.
|
2431 |
+
* @return Deconf_Service_Analytics_CustomDimension
|
2432 |
*/
|
2433 |
+
public function update($accountId, $webPropertyId, $customDimensionId, Deconf_Service_Analytics_CustomDimension $postBody, $optParams = array())
|
2434 |
{
|
2435 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId, 'postBody' => $postBody);
|
2436 |
$params = array_merge($params, $optParams);
|
2437 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_CustomDimension");
|
2438 |
}
|
2439 |
}
|
2440 |
/**
|
2441 |
* The "customMetrics" collection of methods.
|
2442 |
* Typical usage is:
|
2443 |
* <code>
|
2444 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2445 |
* $customMetrics = $analyticsService->customMetrics;
|
2446 |
* </code>
|
2447 |
*/
|
2448 |
+
class Deconf_Service_Analytics_ManagementCustomMetrics_Resource extends Deconf_Service_Resource
|
2449 |
{
|
2450 |
|
2451 |
/**
|
2456 |
* retrieve.
|
2457 |
* @param string $customMetricId The ID of the custom metric to retrieve.
|
2458 |
* @param array $optParams Optional parameters.
|
2459 |
+
* @return Deconf_Service_Analytics_CustomMetric
|
2460 |
*/
|
2461 |
public function get($accountId, $webPropertyId, $customMetricId, $optParams = array())
|
2462 |
{
|
2463 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customMetricId' => $customMetricId);
|
2464 |
$params = array_merge($params, $optParams);
|
2465 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_CustomMetric");
|
2466 |
}
|
2467 |
|
2468 |
/**
|
2471 |
* @param string $accountId Account ID for the custom metric to create.
|
2472 |
* @param string $webPropertyId Web property ID for the custom dimension to
|
2473 |
* create.
|
2474 |
+
* @param Deconf_CustomMetric $postBody
|
2475 |
* @param array $optParams Optional parameters.
|
2476 |
+
* @return Deconf_Service_Analytics_CustomMetric
|
2477 |
*/
|
2478 |
+
public function insert($accountId, $webPropertyId, Deconf_Service_Analytics_CustomMetric $postBody, $optParams = array())
|
2479 |
{
|
2480 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
2481 |
$params = array_merge($params, $optParams);
|
2482 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_CustomMetric");
|
2483 |
}
|
2484 |
|
2485 |
/**
|
2495 |
* this response.
|
2496 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2497 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2498 |
+
* @return Deconf_Service_Analytics_CustomMetrics
|
2499 |
*/
|
2500 |
public function listManagementCustomMetrics($accountId, $webPropertyId, $optParams = array())
|
2501 |
{
|
2502 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
2503 |
$params = array_merge($params, $optParams);
|
2504 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_CustomMetrics");
|
2505 |
}
|
2506 |
|
2507 |
/**
|
2512 |
* @param string $webPropertyId Web property ID for the custom metric to update.
|
2513 |
* @param string $customMetricId Custom metric ID for the custom metric to
|
2514 |
* update.
|
2515 |
+
* @param Deconf_CustomMetric $postBody
|
2516 |
* @param array $optParams Optional parameters.
|
2517 |
*
|
2518 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2519 |
* warnings related to the custom metric being linked to a custom data source /
|
2520 |
* data set.
|
2521 |
+
* @return Deconf_Service_Analytics_CustomMetric
|
2522 |
*/
|
2523 |
+
public function patch($accountId, $webPropertyId, $customMetricId, Deconf_Service_Analytics_CustomMetric $postBody, $optParams = array())
|
2524 |
{
|
2525 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customMetricId' => $customMetricId, 'postBody' => $postBody);
|
2526 |
$params = array_merge($params, $optParams);
|
2527 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_CustomMetric");
|
2528 |
}
|
2529 |
|
2530 |
/**
|
2534 |
* @param string $webPropertyId Web property ID for the custom metric to update.
|
2535 |
* @param string $customMetricId Custom metric ID for the custom metric to
|
2536 |
* update.
|
2537 |
+
* @param Deconf_CustomMetric $postBody
|
2538 |
* @param array $optParams Optional parameters.
|
2539 |
*
|
2540 |
* @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
2541 |
* warnings related to the custom metric being linked to a custom data source /
|
2542 |
* data set.
|
2543 |
+
* @return Deconf_Service_Analytics_CustomMetric
|
2544 |
*/
|
2545 |
+
public function update($accountId, $webPropertyId, $customMetricId, Deconf_Service_Analytics_CustomMetric $postBody, $optParams = array())
|
2546 |
{
|
2547 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customMetricId' => $customMetricId, 'postBody' => $postBody);
|
2548 |
$params = array_merge($params, $optParams);
|
2549 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_CustomMetric");
|
2550 |
}
|
2551 |
}
|
2552 |
/**
|
2553 |
* The "experiments" collection of methods.
|
2554 |
* Typical usage is:
|
2555 |
* <code>
|
2556 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2557 |
* $experiments = $analyticsService->experiments;
|
2558 |
* </code>
|
2559 |
*/
|
2560 |
+
class Deconf_Service_Analytics_ManagementExperiments_Resource extends Deconf_Service_Resource
|
2561 |
{
|
2562 |
|
2563 |
/**
|
2584 |
* @param string $profileId View (Profile) ID to retrieve the experiment for.
|
2585 |
* @param string $experimentId Experiment ID to retrieve the experiment for.
|
2586 |
* @param array $optParams Optional parameters.
|
2587 |
+
* @return Deconf_Service_Analytics_Experiment
|
2588 |
*/
|
2589 |
public function get($accountId, $webPropertyId, $profileId, $experimentId, $optParams = array())
|
2590 |
{
|
2591 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId);
|
2592 |
$params = array_merge($params, $optParams);
|
2593 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_Experiment");
|
2594 |
}
|
2595 |
|
2596 |
/**
|
2599 |
* @param string $accountId Account ID to create the experiment for.
|
2600 |
* @param string $webPropertyId Web property ID to create the experiment for.
|
2601 |
* @param string $profileId View (Profile) ID to create the experiment for.
|
2602 |
+
* @param Deconf_Experiment $postBody
|
2603 |
* @param array $optParams Optional parameters.
|
2604 |
+
* @return Deconf_Service_Analytics_Experiment
|
2605 |
*/
|
2606 |
+
public function insert($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_Experiment $postBody, $optParams = array())
|
2607 |
{
|
2608 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
2609 |
$params = array_merge($params, $optParams);
|
2610 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_Experiment");
|
2611 |
}
|
2612 |
|
2613 |
/**
|
2624 |
* @opt_param int start-index An index of the first experiment to retrieve. Use
|
2625 |
* this parameter as a pagination mechanism along with the max-results
|
2626 |
* parameter.
|
2627 |
+
* @return Deconf_Service_Analytics_Experiments
|
2628 |
*/
|
2629 |
public function listManagementExperiments($accountId, $webPropertyId, $profileId, $optParams = array())
|
2630 |
{
|
2631 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
2632 |
$params = array_merge($params, $optParams);
|
2633 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Experiments");
|
2634 |
}
|
2635 |
|
2636 |
/**
|
2641 |
* @param string $webPropertyId Web property ID of the experiment to update.
|
2642 |
* @param string $profileId View (Profile) ID of the experiment to update.
|
2643 |
* @param string $experimentId Experiment ID of the experiment to update.
|
2644 |
+
* @param Deconf_Experiment $postBody
|
2645 |
* @param array $optParams Optional parameters.
|
2646 |
+
* @return Deconf_Service_Analytics_Experiment
|
2647 |
*/
|
2648 |
+
public function patch($accountId, $webPropertyId, $profileId, $experimentId, Deconf_Service_Analytics_Experiment $postBody, $optParams = array())
|
2649 |
{
|
2650 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody);
|
2651 |
$params = array_merge($params, $optParams);
|
2652 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_Experiment");
|
2653 |
}
|
2654 |
|
2655 |
/**
|
2659 |
* @param string $webPropertyId Web property ID of the experiment to update.
|
2660 |
* @param string $profileId View (Profile) ID of the experiment to update.
|
2661 |
* @param string $experimentId Experiment ID of the experiment to update.
|
2662 |
+
* @param Deconf_Experiment $postBody
|
2663 |
* @param array $optParams Optional parameters.
|
2664 |
+
* @return Deconf_Service_Analytics_Experiment
|
2665 |
*/
|
2666 |
+
public function update($accountId, $webPropertyId, $profileId, $experimentId, Deconf_Service_Analytics_Experiment $postBody, $optParams = array())
|
2667 |
{
|
2668 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'experimentId' => $experimentId, 'postBody' => $postBody);
|
2669 |
$params = array_merge($params, $optParams);
|
2670 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_Experiment");
|
2671 |
}
|
2672 |
}
|
2673 |
/**
|
2674 |
* The "filters" collection of methods.
|
2675 |
* Typical usage is:
|
2676 |
* <code>
|
2677 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2678 |
* $filters = $analyticsService->filters;
|
2679 |
* </code>
|
2680 |
*/
|
2681 |
+
class Deconf_Service_Analytics_ManagementFilters_Resource extends Deconf_Service_Resource
|
2682 |
{
|
2683 |
|
2684 |
/**
|
2687 |
* @param string $accountId Account ID to delete the filter for.
|
2688 |
* @param string $filterId ID of the filter to be deleted.
|
2689 |
* @param array $optParams Optional parameters.
|
2690 |
+
* @return Deconf_Service_Analytics_Filter
|
2691 |
*/
|
2692 |
public function delete($accountId, $filterId, $optParams = array())
|
2693 |
{
|
2694 |
$params = array('accountId' => $accountId, 'filterId' => $filterId);
|
2695 |
$params = array_merge($params, $optParams);
|
2696 |
+
return $this->call('delete', array($params), "Deconf_Service_Analytics_Filter");
|
2697 |
}
|
2698 |
|
2699 |
/**
|
2702 |
* @param string $accountId Account ID to retrieve filters for.
|
2703 |
* @param string $filterId Filter ID to retrieve filters for.
|
2704 |
* @param array $optParams Optional parameters.
|
2705 |
+
* @return Deconf_Service_Analytics_Filter
|
2706 |
*/
|
2707 |
public function get($accountId, $filterId, $optParams = array())
|
2708 |
{
|
2709 |
$params = array('accountId' => $accountId, 'filterId' => $filterId);
|
2710 |
$params = array_merge($params, $optParams);
|
2711 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_Filter");
|
2712 |
}
|
2713 |
|
2714 |
/**
|
2715 |
* Create a new filter. (filters.insert)
|
2716 |
*
|
2717 |
* @param string $accountId Account ID to create filter for.
|
2718 |
+
* @param Deconf_Filter $postBody
|
2719 |
* @param array $optParams Optional parameters.
|
2720 |
+
* @return Deconf_Service_Analytics_Filter
|
2721 |
*/
|
2722 |
+
public function insert($accountId, Deconf_Service_Analytics_Filter $postBody, $optParams = array())
|
2723 |
{
|
2724 |
$params = array('accountId' => $accountId, 'postBody' => $postBody);
|
2725 |
$params = array_merge($params, $optParams);
|
2726 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_Filter");
|
2727 |
}
|
2728 |
|
2729 |
/**
|
2736 |
* response.
|
2737 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2738 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2739 |
+
* @return Deconf_Service_Analytics_Filters
|
2740 |
*/
|
2741 |
public function listManagementFilters($accountId, $optParams = array())
|
2742 |
{
|
2743 |
$params = array('accountId' => $accountId);
|
2744 |
$params = array_merge($params, $optParams);
|
2745 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Filters");
|
2746 |
}
|
2747 |
|
2748 |
/**
|
2751 |
*
|
2752 |
* @param string $accountId Account ID to which the filter belongs.
|
2753 |
* @param string $filterId ID of the filter to be updated.
|
2754 |
+
* @param Deconf_Filter $postBody
|
2755 |
* @param array $optParams Optional parameters.
|
2756 |
+
* @return Deconf_Service_Analytics_Filter
|
2757 |
*/
|
2758 |
+
public function patch($accountId, $filterId, Deconf_Service_Analytics_Filter $postBody, $optParams = array())
|
2759 |
{
|
2760 |
$params = array('accountId' => $accountId, 'filterId' => $filterId, 'postBody' => $postBody);
|
2761 |
$params = array_merge($params, $optParams);
|
2762 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_Filter");
|
2763 |
}
|
2764 |
|
2765 |
/**
|
2767 |
*
|
2768 |
* @param string $accountId Account ID to which the filter belongs.
|
2769 |
* @param string $filterId ID of the filter to be updated.
|
2770 |
+
* @param Deconf_Filter $postBody
|
2771 |
* @param array $optParams Optional parameters.
|
2772 |
+
* @return Deconf_Service_Analytics_Filter
|
2773 |
*/
|
2774 |
+
public function update($accountId, $filterId, Deconf_Service_Analytics_Filter $postBody, $optParams = array())
|
2775 |
{
|
2776 |
$params = array('accountId' => $accountId, 'filterId' => $filterId, 'postBody' => $postBody);
|
2777 |
$params = array_merge($params, $optParams);
|
2778 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_Filter");
|
2779 |
}
|
2780 |
}
|
2781 |
/**
|
2782 |
* The "goals" collection of methods.
|
2783 |
* Typical usage is:
|
2784 |
* <code>
|
2785 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2786 |
* $goals = $analyticsService->goals;
|
2787 |
* </code>
|
2788 |
*/
|
2789 |
+
class Deconf_Service_Analytics_ManagementGoals_Resource extends Deconf_Service_Resource
|
2790 |
{
|
2791 |
|
2792 |
/**
|
2797 |
* @param string $profileId View (Profile) ID to retrieve the goal for.
|
2798 |
* @param string $goalId Goal ID to retrieve the goal for.
|
2799 |
* @param array $optParams Optional parameters.
|
2800 |
+
* @return Deconf_Service_Analytics_Goal
|
2801 |
*/
|
2802 |
public function get($accountId, $webPropertyId, $profileId, $goalId, $optParams = array())
|
2803 |
{
|
2804 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId);
|
2805 |
$params = array_merge($params, $optParams);
|
2806 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_Goal");
|
2807 |
}
|
2808 |
|
2809 |
/**
|
2812 |
* @param string $accountId Account ID to create the goal for.
|
2813 |
* @param string $webPropertyId Web property ID to create the goal for.
|
2814 |
* @param string $profileId View (Profile) ID to create the goal for.
|
2815 |
+
* @param Deconf_Goal $postBody
|
2816 |
* @param array $optParams Optional parameters.
|
2817 |
+
* @return Deconf_Service_Analytics_Goal
|
2818 |
*/
|
2819 |
+
public function insert($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_Goal $postBody, $optParams = array())
|
2820 |
{
|
2821 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
2822 |
$params = array_merge($params, $optParams);
|
2823 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_Goal");
|
2824 |
}
|
2825 |
|
2826 |
/**
|
2841 |
* response.
|
2842 |
* @opt_param int start-index An index of the first goal to retrieve. Use this
|
2843 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2844 |
+
* @return Deconf_Service_Analytics_Goals
|
2845 |
*/
|
2846 |
public function listManagementGoals($accountId, $webPropertyId, $profileId, $optParams = array())
|
2847 |
{
|
2848 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
2849 |
$params = array_merge($params, $optParams);
|
2850 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Goals");
|
2851 |
}
|
2852 |
|
2853 |
/**
|
2858 |
* @param string $webPropertyId Web property ID to update the goal.
|
2859 |
* @param string $profileId View (Profile) ID to update the goal.
|
2860 |
* @param string $goalId Index of the goal to be updated.
|
2861 |
+
* @param Deconf_Goal $postBody
|
2862 |
* @param array $optParams Optional parameters.
|
2863 |
+
* @return Deconf_Service_Analytics_Goal
|
2864 |
*/
|
2865 |
+
public function patch($accountId, $webPropertyId, $profileId, $goalId, Deconf_Service_Analytics_Goal $postBody, $optParams = array())
|
2866 |
{
|
2867 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody);
|
2868 |
$params = array_merge($params, $optParams);
|
2869 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_Goal");
|
2870 |
}
|
2871 |
|
2872 |
/**
|
2876 |
* @param string $webPropertyId Web property ID to update the goal.
|
2877 |
* @param string $profileId View (Profile) ID to update the goal.
|
2878 |
* @param string $goalId Index of the goal to be updated.
|
2879 |
+
* @param Deconf_Goal $postBody
|
2880 |
* @param array $optParams Optional parameters.
|
2881 |
+
* @return Deconf_Service_Analytics_Goal
|
2882 |
*/
|
2883 |
+
public function update($accountId, $webPropertyId, $profileId, $goalId, Deconf_Service_Analytics_Goal $postBody, $optParams = array())
|
2884 |
{
|
2885 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody);
|
2886 |
$params = array_merge($params, $optParams);
|
2887 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_Goal");
|
2888 |
}
|
2889 |
}
|
2890 |
/**
|
2891 |
* The "profileFilterLinks" collection of methods.
|
2892 |
* Typical usage is:
|
2893 |
* <code>
|
2894 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
2895 |
* $profileFilterLinks = $analyticsService->profileFilterLinks;
|
2896 |
* </code>
|
2897 |
*/
|
2898 |
+
class Deconf_Service_Analytics_ManagementProfileFilterLinks_Resource extends Deconf_Service_Resource
|
2899 |
{
|
2900 |
|
2901 |
/**
|
2924 |
* @param string $profileId Profile ID to retrieve filter link for.
|
2925 |
* @param string $linkId ID of the profile filter link.
|
2926 |
* @param array $optParams Optional parameters.
|
2927 |
+
* @return Deconf_Service_Analytics_ProfileFilterLink
|
2928 |
*/
|
2929 |
public function get($accountId, $webPropertyId, $profileId, $linkId, $optParams = array())
|
2930 |
{
|
2931 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId);
|
2932 |
$params = array_merge($params, $optParams);
|
2933 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_ProfileFilterLink");
|
2934 |
}
|
2935 |
|
2936 |
/**
|
2940 |
* @param string $webPropertyId Web property Id to create profile filter link
|
2941 |
* for.
|
2942 |
* @param string $profileId Profile ID to create filter link for.
|
2943 |
+
* @param Deconf_ProfileFilterLink $postBody
|
2944 |
* @param array $optParams Optional parameters.
|
2945 |
+
* @return Deconf_Service_Analytics_ProfileFilterLink
|
2946 |
*/
|
2947 |
+
public function insert($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_ProfileFilterLink $postBody, $optParams = array())
|
2948 |
{
|
2949 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
2950 |
$params = array_merge($params, $optParams);
|
2951 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_ProfileFilterLink");
|
2952 |
}
|
2953 |
|
2954 |
/**
|
2968 |
* include in this response.
|
2969 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
2970 |
* parameter as a pagination mechanism along with the max-results parameter.
|
2971 |
+
* @return Deconf_Service_Analytics_ProfileFilterLinks
|
2972 |
*/
|
2973 |
public function listManagementProfileFilterLinks($accountId, $webPropertyId, $profileId, $optParams = array())
|
2974 |
{
|
2975 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
2976 |
$params = array_merge($params, $optParams);
|
2977 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_ProfileFilterLinks");
|
2978 |
}
|
2979 |
|
2980 |
/**
|
2986 |
* belongs
|
2987 |
* @param string $profileId Profile ID to which filter link belongs
|
2988 |
* @param string $linkId ID of the profile filter link to be updated.
|
2989 |
+
* @param Deconf_ProfileFilterLink $postBody
|
2990 |
* @param array $optParams Optional parameters.
|
2991 |
+
* @return Deconf_Service_Analytics_ProfileFilterLink
|
2992 |
*/
|
2993 |
+
public function patch($accountId, $webPropertyId, $profileId, $linkId, Deconf_Service_Analytics_ProfileFilterLink $postBody, $optParams = array())
|
2994 |
{
|
2995 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody);
|
2996 |
$params = array_merge($params, $optParams);
|
2997 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_ProfileFilterLink");
|
2998 |
}
|
2999 |
|
3000 |
/**
|
3005 |
* belongs
|
3006 |
* @param string $profileId Profile ID to which filter link belongs
|
3007 |
* @param string $linkId ID of the profile filter link to be updated.
|
3008 |
+
* @param Deconf_ProfileFilterLink $postBody
|
3009 |
* @param array $optParams Optional parameters.
|
3010 |
+
* @return Deconf_Service_Analytics_ProfileFilterLink
|
3011 |
*/
|
3012 |
+
public function update($accountId, $webPropertyId, $profileId, $linkId, Deconf_Service_Analytics_ProfileFilterLink $postBody, $optParams = array())
|
3013 |
{
|
3014 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody);
|
3015 |
$params = array_merge($params, $optParams);
|
3016 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_ProfileFilterLink");
|
3017 |
}
|
3018 |
}
|
3019 |
/**
|
3020 |
* The "profileUserLinks" collection of methods.
|
3021 |
* Typical usage is:
|
3022 |
* <code>
|
3023 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3024 |
* $profileUserLinks = $analyticsService->profileUserLinks;
|
3025 |
* </code>
|
3026 |
*/
|
3027 |
+
class Deconf_Service_Analytics_ManagementProfileUserLinks_Resource extends Deconf_Service_Resource
|
3028 |
{
|
3029 |
|
3030 |
/**
|
3049 |
* @param string $accountId Account ID to create the user link for.
|
3050 |
* @param string $webPropertyId Web Property ID to create the user link for.
|
3051 |
* @param string $profileId View (Profile) ID to create the user link for.
|
3052 |
+
* @param Deconf_EntityUserLink $postBody
|
3053 |
* @param array $optParams Optional parameters.
|
3054 |
+
* @return Deconf_Service_Analytics_EntityUserLink
|
3055 |
*/
|
3056 |
+
public function insert($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_EntityUserLink $postBody, $optParams = array())
|
3057 |
{
|
3058 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3059 |
$params = array_merge($params, $optParams);
|
3060 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_EntityUserLink");
|
3061 |
}
|
3062 |
|
3063 |
/**
|
3079 |
* @opt_param int start-index An index of the first profile-user link to
|
3080 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3081 |
* results parameter.
|
3082 |
+
* @return Deconf_Service_Analytics_EntityUserLinks
|
3083 |
*/
|
3084 |
public function listManagementProfileUserLinks($accountId, $webPropertyId, $profileId, $optParams = array())
|
3085 |
{
|
3086 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
3087 |
$params = array_merge($params, $optParams);
|
3088 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_EntityUserLinks");
|
3089 |
}
|
3090 |
|
3091 |
/**
|
3096 |
* @param string $webPropertyId Web Property ID to update the user link for.
|
3097 |
* @param string $profileId View (Profile ID) to update the user link for.
|
3098 |
* @param string $linkId Link ID to update the user link for.
|
3099 |
+
* @param Deconf_EntityUserLink $postBody
|
3100 |
* @param array $optParams Optional parameters.
|
3101 |
+
* @return Deconf_Service_Analytics_EntityUserLink
|
3102 |
*/
|
3103 |
+
public function update($accountId, $webPropertyId, $profileId, $linkId, Deconf_Service_Analytics_EntityUserLink $postBody, $optParams = array())
|
3104 |
{
|
3105 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'linkId' => $linkId, 'postBody' => $postBody);
|
3106 |
$params = array_merge($params, $optParams);
|
3107 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_EntityUserLink");
|
3108 |
}
|
3109 |
}
|
3110 |
/**
|
3111 |
* The "profiles" collection of methods.
|
3112 |
* Typical usage is:
|
3113 |
* <code>
|
3114 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3115 |
* $profiles = $analyticsService->profiles;
|
3116 |
* </code>
|
3117 |
*/
|
3118 |
+
class Deconf_Service_Analytics_ManagementProfiles_Resource extends Deconf_Service_Resource
|
3119 |
{
|
3120 |
|
3121 |
/**
|
3141 |
* @param string $webPropertyId Web property ID to retrieve the goal for.
|
3142 |
* @param string $profileId View (Profile) ID to retrieve the goal for.
|
3143 |
* @param array $optParams Optional parameters.
|
3144 |
+
* @return Deconf_Service_Analytics_Profile
|
3145 |
*/
|
3146 |
public function get($accountId, $webPropertyId, $profileId, $optParams = array())
|
3147 |
{
|
3148 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
3149 |
$params = array_merge($params, $optParams);
|
3150 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_Profile");
|
3151 |
}
|
3152 |
|
3153 |
/**
|
3156 |
* @param string $accountId Account ID to create the view (profile) for.
|
3157 |
* @param string $webPropertyId Web property ID to create the view (profile)
|
3158 |
* for.
|
3159 |
+
* @param Deconf_Profile $postBody
|
3160 |
* @param array $optParams Optional parameters.
|
3161 |
+
* @return Deconf_Service_Analytics_Profile
|
3162 |
*/
|
3163 |
+
public function insert($accountId, $webPropertyId, Deconf_Service_Analytics_Profile $postBody, $optParams = array())
|
3164 |
{
|
3165 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3166 |
$params = array_merge($params, $optParams);
|
3167 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_Profile");
|
3168 |
}
|
3169 |
|
3170 |
/**
|
3183 |
* in this response.
|
3184 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
3185 |
* parameter as a pagination mechanism along with the max-results parameter.
|
3186 |
+
* @return Deconf_Service_Analytics_Profiles
|
3187 |
*/
|
3188 |
public function listManagementProfiles($accountId, $webPropertyId, $optParams = array())
|
3189 |
{
|
3190 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3191 |
$params = array_merge($params, $optParams);
|
3192 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Profiles");
|
3193 |
}
|
3194 |
|
3195 |
/**
|
3200 |
* @param string $webPropertyId Web property ID to which the view (profile)
|
3201 |
* belongs
|
3202 |
* @param string $profileId ID of the view (profile) to be updated.
|
3203 |
+
* @param Deconf_Profile $postBody
|
3204 |
* @param array $optParams Optional parameters.
|
3205 |
+
* @return Deconf_Service_Analytics_Profile
|
3206 |
*/
|
3207 |
+
public function patch($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_Profile $postBody, $optParams = array())
|
3208 |
{
|
3209 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3210 |
$params = array_merge($params, $optParams);
|
3211 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_Profile");
|
3212 |
}
|
3213 |
|
3214 |
/**
|
3218 |
* @param string $webPropertyId Web property ID to which the view (profile)
|
3219 |
* belongs
|
3220 |
* @param string $profileId ID of the view (profile) to be updated.
|
3221 |
+
* @param Deconf_Profile $postBody
|
3222 |
* @param array $optParams Optional parameters.
|
3223 |
+
* @return Deconf_Service_Analytics_Profile
|
3224 |
*/
|
3225 |
+
public function update($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_Profile $postBody, $optParams = array())
|
3226 |
{
|
3227 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3228 |
$params = array_merge($params, $optParams);
|
3229 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_Profile");
|
3230 |
}
|
3231 |
}
|
3232 |
/**
|
3233 |
* The "segments" collection of methods.
|
3234 |
* Typical usage is:
|
3235 |
* <code>
|
3236 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3237 |
* $segments = $analyticsService->segments;
|
3238 |
* </code>
|
3239 |
*/
|
3240 |
+
class Deconf_Service_Analytics_ManagementSegments_Resource extends Deconf_Service_Resource
|
3241 |
{
|
3242 |
|
3243 |
/**
|
3251 |
* @opt_param int start-index An index of the first segment to retrieve. Use
|
3252 |
* this parameter as a pagination mechanism along with the max-results
|
3253 |
* parameter.
|
3254 |
+
* @return Deconf_Service_Analytics_Segments
|
3255 |
*/
|
3256 |
public function listManagementSegments($optParams = array())
|
3257 |
{
|
3258 |
$params = array();
|
3259 |
$params = array_merge($params, $optParams);
|
3260 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Segments");
|
3261 |
}
|
3262 |
}
|
3263 |
/**
|
3264 |
* The "unsampledReports" collection of methods.
|
3265 |
* Typical usage is:
|
3266 |
* <code>
|
3267 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3268 |
* $unsampledReports = $analyticsService->unsampledReports;
|
3269 |
* </code>
|
3270 |
*/
|
3271 |
+
class Deconf_Service_Analytics_ManagementUnsampledReports_Resource extends Deconf_Service_Resource
|
3272 |
{
|
3273 |
|
3274 |
/**
|
3298 |
* @param string $profileId View (Profile) ID to retrieve unsampled report for.
|
3299 |
* @param string $unsampledReportId ID of the unsampled report to retrieve.
|
3300 |
* @param array $optParams Optional parameters.
|
3301 |
+
* @return Deconf_Service_Analytics_UnsampledReport
|
3302 |
*/
|
3303 |
public function get($accountId, $webPropertyId, $profileId, $unsampledReportId, $optParams = array())
|
3304 |
{
|
3305 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'unsampledReportId' => $unsampledReportId);
|
3306 |
$params = array_merge($params, $optParams);
|
3307 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_UnsampledReport");
|
3308 |
}
|
3309 |
|
3310 |
/**
|
3315 |
* for.
|
3316 |
* @param string $profileId View (Profile) ID to create the unsampled report
|
3317 |
* for.
|
3318 |
+
* @param Deconf_UnsampledReport $postBody
|
3319 |
* @param array $optParams Optional parameters.
|
3320 |
+
* @return Deconf_Service_Analytics_UnsampledReport
|
3321 |
*/
|
3322 |
+
public function insert($accountId, $webPropertyId, $profileId, Deconf_Service_Analytics_UnsampledReport $postBody, $optParams = array())
|
3323 |
{
|
3324 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody);
|
3325 |
$params = array_merge($params, $optParams);
|
3326 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_UnsampledReport");
|
3327 |
}
|
3328 |
|
3329 |
/**
|
3343 |
* @opt_param int start-index An index of the first unsampled report to
|
3344 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3345 |
* results parameter.
|
3346 |
+
* @return Deconf_Service_Analytics_UnsampledReports
|
3347 |
*/
|
3348 |
public function listManagementUnsampledReports($accountId, $webPropertyId, $profileId, $optParams = array())
|
3349 |
{
|
3350 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
|
3351 |
$params = array_merge($params, $optParams);
|
3352 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_UnsampledReports");
|
3353 |
}
|
3354 |
}
|
3355 |
/**
|
3356 |
* The "uploads" collection of methods.
|
3357 |
* Typical usage is:
|
3358 |
* <code>
|
3359 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3360 |
* $uploads = $analyticsService->uploads;
|
3361 |
* </code>
|
3362 |
*/
|
3363 |
+
class Deconf_Service_Analytics_ManagementUploads_Resource extends Deconf_Service_Resource
|
3364 |
{
|
3365 |
|
3366 |
/**
|
3370 |
* @param string $webPropertyId Web property Id for the uploads to be deleted.
|
3371 |
* @param string $customDataSourceId Custom data source Id for the uploads to be
|
3372 |
* deleted.
|
3373 |
+
* @param Deconf_AnalyticsDataimportDeleteUploadDataRequest $postBody
|
3374 |
* @param array $optParams Optional parameters.
|
3375 |
*/
|
3376 |
+
public function deleteUploadData($accountId, $webPropertyId, $customDataSourceId, Deconf_Service_Analytics_AnalyticsDataimportDeleteUploadDataRequest $postBody, $optParams = array())
|
3377 |
{
|
3378 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'postBody' => $postBody);
|
3379 |
$params = array_merge($params, $optParams);
|
3389 |
* retrieve.
|
3390 |
* @param string $uploadId Upload Id to retrieve.
|
3391 |
* @param array $optParams Optional parameters.
|
3392 |
+
* @return Deconf_Service_Analytics_Upload
|
3393 |
*/
|
3394 |
public function get($accountId, $webPropertyId, $customDataSourceId, $uploadId, $optParams = array())
|
3395 |
{
|
3396 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'uploadId' => $uploadId);
|
3397 |
$params = array_merge($params, $optParams);
|
3398 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_Upload");
|
3399 |
}
|
3400 |
|
3401 |
/**
|
3412 |
* @opt_param int start-index A 1-based index of the first upload to retrieve.
|
3413 |
* Use this parameter as a pagination mechanism along with the max-results
|
3414 |
* parameter.
|
3415 |
+
* @return Deconf_Service_Analytics_Uploads
|
3416 |
*/
|
3417 |
public function listManagementUploads($accountId, $webPropertyId, $customDataSourceId, $optParams = array())
|
3418 |
{
|
3419 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId);
|
3420 |
$params = array_merge($params, $optParams);
|
3421 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Uploads");
|
3422 |
}
|
3423 |
|
3424 |
/**
|
3430 |
* @param string $customDataSourceId Custom data source Id to which the data
|
3431 |
* being uploaded belongs.
|
3432 |
* @param array $optParams Optional parameters.
|
3433 |
+
* @return Deconf_Service_Analytics_Upload
|
3434 |
*/
|
3435 |
public function uploadData($accountId, $webPropertyId, $customDataSourceId, $optParams = array())
|
3436 |
{
|
3437 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId);
|
3438 |
$params = array_merge($params, $optParams);
|
3439 |
+
return $this->call('uploadData', array($params), "Deconf_Service_Analytics_Upload");
|
3440 |
}
|
3441 |
}
|
3442 |
/**
|
3443 |
* The "webPropertyAdWordsLinks" collection of methods.
|
3444 |
* Typical usage is:
|
3445 |
* <code>
|
3446 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3447 |
* $webPropertyAdWordsLinks = $analyticsService->webPropertyAdWordsLinks;
|
3448 |
* </code>
|
3449 |
*/
|
3450 |
+
class Deconf_Service_Analytics_ManagementWebPropertyAdWordsLinks_Resource extends Deconf_Service_Resource
|
3451 |
{
|
3452 |
|
3453 |
/**
|
3476 |
* for.
|
3477 |
* @param string $webPropertyAdWordsLinkId Web property-AdWords link ID.
|
3478 |
* @param array $optParams Optional parameters.
|
3479 |
+
* @return Deconf_Service_Analytics_EntityAdWordsLink
|
3480 |
*/
|
3481 |
public function get($accountId, $webPropertyId, $webPropertyAdWordsLinkId, $optParams = array())
|
3482 |
{
|
3483 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId);
|
3484 |
$params = array_merge($params, $optParams);
|
3485 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_EntityAdWordsLink");
|
3486 |
}
|
3487 |
|
3488 |
/**
|
3491 |
* @param string $accountId ID of the Google Analytics account to create the
|
3492 |
* link for.
|
3493 |
* @param string $webPropertyId Web property ID to create the link for.
|
3494 |
+
* @param Deconf_EntityAdWordsLink $postBody
|
3495 |
* @param array $optParams Optional parameters.
|
3496 |
+
* @return Deconf_Service_Analytics_EntityAdWordsLink
|
3497 |
*/
|
3498 |
+
public function insert($accountId, $webPropertyId, Deconf_Service_Analytics_EntityAdWordsLink $postBody, $optParams = array())
|
3499 |
{
|
3500 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3501 |
$params = array_merge($params, $optParams);
|
3502 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_EntityAdWordsLink");
|
3503 |
}
|
3504 |
|
3505 |
/**
|
3517 |
* @opt_param int start-index An index of the first webProperty-AdWords link to
|
3518 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3519 |
* results parameter.
|
3520 |
+
* @return Deconf_Service_Analytics_EntityAdWordsLinks
|
3521 |
*/
|
3522 |
public function listManagementWebPropertyAdWordsLinks($accountId, $webPropertyId, $optParams = array())
|
3523 |
{
|
3524 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3525 |
$params = array_merge($params, $optParams);
|
3526 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_EntityAdWordsLinks");
|
3527 |
}
|
3528 |
|
3529 |
/**
|
3535 |
* @param string $webPropertyId Web property ID to retrieve the AdWords link
|
3536 |
* for.
|
3537 |
* @param string $webPropertyAdWordsLinkId Web property-AdWords link ID.
|
3538 |
+
* @param Deconf_EntityAdWordsLink $postBody
|
3539 |
* @param array $optParams Optional parameters.
|
3540 |
+
* @return Deconf_Service_Analytics_EntityAdWordsLink
|
3541 |
*/
|
3542 |
+
public function patch($accountId, $webPropertyId, $webPropertyAdWordsLinkId, Deconf_Service_Analytics_EntityAdWordsLink $postBody, $optParams = array())
|
3543 |
{
|
3544 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId, 'postBody' => $postBody);
|
3545 |
$params = array_merge($params, $optParams);
|
3546 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_EntityAdWordsLink");
|
3547 |
}
|
3548 |
|
3549 |
/**
|
3555 |
* @param string $webPropertyId Web property ID to retrieve the AdWords link
|
3556 |
* for.
|
3557 |
* @param string $webPropertyAdWordsLinkId Web property-AdWords link ID.
|
3558 |
+
* @param Deconf_EntityAdWordsLink $postBody
|
3559 |
* @param array $optParams Optional parameters.
|
3560 |
+
* @return Deconf_Service_Analytics_EntityAdWordsLink
|
3561 |
*/
|
3562 |
+
public function update($accountId, $webPropertyId, $webPropertyAdWordsLinkId, Deconf_Service_Analytics_EntityAdWordsLink $postBody, $optParams = array())
|
3563 |
{
|
3564 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId, 'postBody' => $postBody);
|
3565 |
$params = array_merge($params, $optParams);
|
3566 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_EntityAdWordsLink");
|
3567 |
}
|
3568 |
}
|
3569 |
/**
|
3570 |
* The "webproperties" collection of methods.
|
3571 |
* Typical usage is:
|
3572 |
* <code>
|
3573 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3574 |
* $webproperties = $analyticsService->webproperties;
|
3575 |
* </code>
|
3576 |
*/
|
3577 |
+
class Deconf_Service_Analytics_ManagementWebproperties_Resource extends Deconf_Service_Resource
|
3578 |
{
|
3579 |
|
3580 |
/**
|
3583 |
* @param string $accountId Account ID to retrieve the web property for.
|
3584 |
* @param string $webPropertyId ID to retrieve the web property for.
|
3585 |
* @param array $optParams Optional parameters.
|
3586 |
+
* @return Deconf_Service_Analytics_Webproperty
|
3587 |
*/
|
3588 |
public function get($accountId, $webPropertyId, $optParams = array())
|
3589 |
{
|
3590 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3591 |
$params = array_merge($params, $optParams);
|
3592 |
+
return $this->call('get', array($params), "Deconf_Service_Analytics_Webproperty");
|
3593 |
}
|
3594 |
|
3595 |
/**
|
3598 |
* least one profile. (webproperties.insert)
|
3599 |
*
|
3600 |
* @param string $accountId Account ID to create the web property for.
|
3601 |
+
* @param Deconf_Webproperty $postBody
|
3602 |
* @param array $optParams Optional parameters.
|
3603 |
+
* @return Deconf_Service_Analytics_Webproperty
|
3604 |
*/
|
3605 |
+
public function insert($accountId, Deconf_Service_Analytics_Webproperty $postBody, $optParams = array())
|
3606 |
{
|
3607 |
$params = array('accountId' => $accountId, 'postBody' => $postBody);
|
3608 |
$params = array_merge($params, $optParams);
|
3609 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_Webproperty");
|
3610 |
}
|
3611 |
|
3612 |
/**
|
3622 |
* this response.
|
3623 |
* @opt_param int start-index An index of the first entity to retrieve. Use this
|
3624 |
* parameter as a pagination mechanism along with the max-results parameter.
|
3625 |
+
* @return Deconf_Service_Analytics_Webproperties
|
3626 |
*/
|
3627 |
public function listManagementWebproperties($accountId, $optParams = array())
|
3628 |
{
|
3629 |
$params = array('accountId' => $accountId);
|
3630 |
$params = array_merge($params, $optParams);
|
3631 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Webproperties");
|
3632 |
}
|
3633 |
|
3634 |
/**
|
3637 |
*
|
3638 |
* @param string $accountId Account ID to which the web property belongs
|
3639 |
* @param string $webPropertyId Web property ID
|
3640 |
+
* @param Deconf_Webproperty $postBody
|
3641 |
* @param array $optParams Optional parameters.
|
3642 |
+
* @return Deconf_Service_Analytics_Webproperty
|
3643 |
*/
|
3644 |
+
public function patch($accountId, $webPropertyId, Deconf_Service_Analytics_Webproperty $postBody, $optParams = array())
|
3645 |
{
|
3646 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3647 |
$params = array_merge($params, $optParams);
|
3648 |
+
return $this->call('patch', array($params), "Deconf_Service_Analytics_Webproperty");
|
3649 |
}
|
3650 |
|
3651 |
/**
|
3653 |
*
|
3654 |
* @param string $accountId Account ID to which the web property belongs
|
3655 |
* @param string $webPropertyId Web property ID
|
3656 |
+
* @param Deconf_Webproperty $postBody
|
3657 |
* @param array $optParams Optional parameters.
|
3658 |
+
* @return Deconf_Service_Analytics_Webproperty
|
3659 |
*/
|
3660 |
+
public function update($accountId, $webPropertyId, Deconf_Service_Analytics_Webproperty $postBody, $optParams = array())
|
3661 |
{
|
3662 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3663 |
$params = array_merge($params, $optParams);
|
3664 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_Webproperty");
|
3665 |
}
|
3666 |
}
|
3667 |
/**
|
3668 |
* The "webpropertyUserLinks" collection of methods.
|
3669 |
* Typical usage is:
|
3670 |
* <code>
|
3671 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3672 |
* $webpropertyUserLinks = $analyticsService->webpropertyUserLinks;
|
3673 |
* </code>
|
3674 |
*/
|
3675 |
+
class Deconf_Service_Analytics_ManagementWebpropertyUserLinks_Resource extends Deconf_Service_Resource
|
3676 |
{
|
3677 |
|
3678 |
/**
|
3695 |
*
|
3696 |
* @param string $accountId Account ID to create the user link for.
|
3697 |
* @param string $webPropertyId Web Property ID to create the user link for.
|
3698 |
+
* @param Deconf_EntityUserLink $postBody
|
3699 |
* @param array $optParams Optional parameters.
|
3700 |
+
* @return Deconf_Service_Analytics_EntityUserLink
|
3701 |
*/
|
3702 |
+
public function insert($accountId, $webPropertyId, Deconf_Service_Analytics_EntityUserLink $postBody, $optParams = array())
|
3703 |
{
|
3704 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody);
|
3705 |
$params = array_merge($params, $optParams);
|
3706 |
+
return $this->call('insert', array($params), "Deconf_Service_Analytics_EntityUserLink");
|
3707 |
}
|
3708 |
|
3709 |
/**
|
3721 |
* @opt_param int start-index An index of the first webProperty-user link to
|
3722 |
* retrieve. Use this parameter as a pagination mechanism along with the max-
|
3723 |
* results parameter.
|
3724 |
+
* @return Deconf_Service_Analytics_EntityUserLinks
|
3725 |
*/
|
3726 |
public function listManagementWebpropertyUserLinks($accountId, $webPropertyId, $optParams = array())
|
3727 |
{
|
3728 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
|
3729 |
$params = array_merge($params, $optParams);
|
3730 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_EntityUserLinks");
|
3731 |
}
|
3732 |
|
3733 |
/**
|
3738 |
* @param string $webPropertyId Web property ID to update the account-user link
|
3739 |
* for.
|
3740 |
* @param string $linkId Link ID to update the account-user link for.
|
3741 |
+
* @param Deconf_EntityUserLink $postBody
|
3742 |
* @param array $optParams Optional parameters.
|
3743 |
+
* @return Deconf_Service_Analytics_EntityUserLink
|
3744 |
*/
|
3745 |
+
public function update($accountId, $webPropertyId, $linkId, Deconf_Service_Analytics_EntityUserLink $postBody, $optParams = array())
|
3746 |
{
|
3747 |
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId, 'postBody' => $postBody);
|
3748 |
$params = array_merge($params, $optParams);
|
3749 |
+
return $this->call('update', array($params), "Deconf_Service_Analytics_EntityUserLink");
|
3750 |
}
|
3751 |
}
|
3752 |
|
3754 |
* The "metadata" collection of methods.
|
3755 |
* Typical usage is:
|
3756 |
* <code>
|
3757 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3758 |
* $metadata = $analyticsService->metadata;
|
3759 |
* </code>
|
3760 |
*/
|
3761 |
+
class Deconf_Service_Analytics_Metadata_Resource extends Deconf_Service_Resource
|
3762 |
{
|
3763 |
}
|
3764 |
|
3766 |
* The "columns" collection of methods.
|
3767 |
* Typical usage is:
|
3768 |
* <code>
|
3769 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3770 |
* $columns = $analyticsService->columns;
|
3771 |
* </code>
|
3772 |
*/
|
3773 |
+
class Deconf_Service_Analytics_MetadataColumns_Resource extends Deconf_Service_Resource
|
3774 |
{
|
3775 |
|
3776 |
/**
|
3779 |
* @param string $reportType Report type. Allowed Values: 'ga'. Where 'ga'
|
3780 |
* corresponds to the Core Reporting API
|
3781 |
* @param array $optParams Optional parameters.
|
3782 |
+
* @return Deconf_Service_Analytics_Columns
|
3783 |
*/
|
3784 |
public function listMetadataColumns($reportType, $optParams = array())
|
3785 |
{
|
3786 |
$params = array('reportType' => $reportType);
|
3787 |
$params = array_merge($params, $optParams);
|
3788 |
+
return $this->call('list', array($params), "Deconf_Service_Analytics_Columns");
|
3789 |
}
|
3790 |
}
|
3791 |
|
3793 |
* The "provisioning" collection of methods.
|
3794 |
* Typical usage is:
|
3795 |
* <code>
|
3796 |
+
* $analyticsService = new Deconf_Service_Analytics(...);
|
3797 |
* $provisioning = $analyticsService->provisioning;
|
3798 |
* </code>
|
3799 |
*/
|
3800 |
+
class Deconf_Service_Analytics_Provisioning_Resource extends Deconf_Service_Resource
|
3801 |
{
|
3802 |
|
3803 |
/**
|
3804 |
* Creates an account ticket. (provisioning.createAccountTicket)
|
3805 |
*
|
3806 |
+
* @param Deconf_AccountTicket $postBody
|
3807 |
* @param array $optParams Optional parameters.
|
3808 |
+
* @return Deconf_Service_Analytics_AccountTicket
|
3809 |
*/
|
3810 |
+
public function createAccountTicket(Deconf_Service_Analytics_AccountTicket $postBody, $optParams = array())
|
3811 |
{
|
3812 |
$params = array('postBody' => $postBody);
|
3813 |
$params = array_merge($params, $optParams);
|
3814 |
+
return $this->call('createAccountTicket', array($params), "Deconf_Service_Analytics_AccountTicket");
|
3815 |
}
|
3816 |
}
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
+
class Deconf_Service_Analytics_Account extends Deconf_Model
|
3822 |
{
|
3823 |
protected $internal_gapi_mappings = array(
|
3824 |
);
|
3825 |
+
protected $childLinkType = 'Deconf_Service_Analytics_AccountChildLink';
|
3826 |
protected $childLinkDataType = '';
|
3827 |
public $created;
|
3828 |
public $id;
|
3829 |
public $kind;
|
3830 |
public $name;
|
3831 |
+
protected $permissionsType = 'Deconf_Service_Analytics_AccountPermissions';
|
3832 |
protected $permissionsDataType = '';
|
3833 |
public $selfLink;
|
3834 |
public $updated;
|
3835 |
|
3836 |
|
3837 |
+
public function setChildLink(Deconf_Service_Analytics_AccountChildLink $childLink)
|
3838 |
{
|
3839 |
$this->childLink = $childLink;
|
3840 |
}
|
3874 |
{
|
3875 |
return $this->name;
|
3876 |
}
|
3877 |
+
public function setPermissions(Deconf_Service_Analytics_AccountPermissions $permissions)
|
3878 |
{
|
3879 |
$this->permissions = $permissions;
|
3880 |
}
|
3900 |
}
|
3901 |
}
|
3902 |
|
3903 |
+
class Deconf_Service_Analytics_AccountChildLink extends Deconf_Model
|
3904 |
{
|
3905 |
protected $internal_gapi_mappings = array(
|
3906 |
);
|
3926 |
}
|
3927 |
}
|
3928 |
|
3929 |
+
class Deconf_Service_Analytics_AccountPermissions extends Deconf_Collection
|
3930 |
{
|
3931 |
protected $collection_key = 'effective';
|
3932 |
protected $internal_gapi_mappings = array(
|
3944 |
}
|
3945 |
}
|
3946 |
|
3947 |
+
class Deconf_Service_Analytics_AccountRef extends Deconf_Model
|
3948 |
{
|
3949 |
protected $internal_gapi_mappings = array(
|
3950 |
);
|
3988 |
}
|
3989 |
}
|
3990 |
|
3991 |
+
class Deconf_Service_Analytics_AccountSummaries extends Deconf_Collection
|
3992 |
{
|
3993 |
protected $collection_key = 'items';
|
3994 |
protected $internal_gapi_mappings = array(
|
3995 |
);
|
3996 |
+
protected $itemsType = 'Deconf_Service_Analytics_AccountSummary';
|
3997 |
protected $itemsDataType = 'array';
|
3998 |
public $itemsPerPage;
|
3999 |
public $kind;
|
4070 |
}
|
4071 |
}
|
4072 |
|
4073 |
+
class Deconf_Service_Analytics_AccountSummary extends Deconf_Collection
|
4074 |
{
|
4075 |
protected $collection_key = 'webProperties';
|
4076 |
protected $internal_gapi_mappings = array(
|
4078 |
public $id;
|
4079 |
public $kind;
|
4080 |
public $name;
|
4081 |
+
protected $webPropertiesType = 'Deconf_Service_Analytics_WebPropertySummary';
|
4082 |
protected $webPropertiesDataType = 'array';
|
4083 |
|
4084 |
|
4116 |
}
|
4117 |
}
|
4118 |
|
4119 |
+
class Deconf_Service_Analytics_AccountTicket extends Deconf_Model
|
4120 |
{
|
4121 |
protected $internal_gapi_mappings = array(
|
4122 |
);
|
4123 |
+
protected $accountType = 'Deconf_Service_Analytics_Account';
|
4124 |
protected $accountDataType = '';
|
4125 |
public $id;
|
4126 |
public $kind;
|
4127 |
+
protected $profileType = 'Deconf_Service_Analytics_Profile';
|
4128 |
protected $profileDataType = '';
|
4129 |
public $redirectUri;
|
4130 |
+
protected $webpropertyType = 'Deconf_Service_Analytics_Webproperty';
|
4131 |
protected $webpropertyDataType = '';
|
4132 |
|
4133 |
|
4134 |
+
public function setAccount(Deconf_Service_Analytics_Account $account)
|
4135 |
{
|
4136 |
$this->account = $account;
|
4137 |
}
|
4155 |
{
|
4156 |
return $this->kind;
|
4157 |
}
|
4158 |
+
public function setProfile(Deconf_Service_Analytics_Profile $profile)
|
4159 |
{
|
4160 |
$this->profile = $profile;
|
4161 |
}
|
4171 |
{
|
4172 |
return $this->redirectUri;
|
4173 |
}
|
4174 |
+
public function setWebproperty(Deconf_Service_Analytics_Webproperty $webproperty)
|
4175 |
{
|
4176 |
$this->webproperty = $webproperty;
|
4177 |
}
|
4181 |
}
|
4182 |
}
|
4183 |
|
4184 |
+
class Deconf_Service_Analytics_Accounts extends Deconf_Collection
|
4185 |
{
|
4186 |
protected $collection_key = 'items';
|
4187 |
protected $internal_gapi_mappings = array(
|
4188 |
);
|
4189 |
+
protected $itemsType = 'Deconf_Service_Analytics_Account';
|
4190 |
protected $itemsDataType = 'array';
|
4191 |
public $itemsPerPage;
|
4192 |
public $kind;
|
4263 |
}
|
4264 |
}
|
4265 |
|
4266 |
+
class Deconf_Service_Analytics_AdWordsAccount extends Deconf_Model
|
4267 |
{
|
4268 |
protected $internal_gapi_mappings = array(
|
4269 |
);
|
4298 |
}
|
4299 |
}
|
4300 |
|
4301 |
+
class Deconf_Service_Analytics_AnalyticsDataimportDeleteUploadDataRequest extends Deconf_Collection
|
4302 |
{
|
4303 |
protected $collection_key = 'customDataImportUids';
|
4304 |
protected $internal_gapi_mappings = array(
|
4316 |
}
|
4317 |
}
|
4318 |
|
4319 |
+
class Deconf_Service_Analytics_Column extends Deconf_Model
|
4320 |
{
|
4321 |
protected $internal_gapi_mappings = array(
|
4322 |
);
|
4351 |
}
|
4352 |
}
|
4353 |
|
4354 |
+
class Deconf_Service_Analytics_Columns extends Deconf_Collection
|
4355 |
{
|
4356 |
protected $collection_key = 'items';
|
4357 |
protected $internal_gapi_mappings = array(
|
4358 |
);
|
4359 |
public $attributeNames;
|
4360 |
public $etag;
|
4361 |
+
protected $itemsType = 'Deconf_Service_Analytics_Column';
|
4362 |
protected $itemsDataType = 'array';
|
4363 |
public $kind;
|
4364 |
public $totalResults;
|
4406 |
}
|
4407 |
}
|
4408 |
|
4409 |
+
class Deconf_Service_Analytics_CustomDataSource extends Deconf_Collection
|
4410 |
{
|
4411 |
protected $collection_key = 'profilesLinked';
|
4412 |
protected $internal_gapi_mappings = array(
|
4413 |
);
|
4414 |
public $accountId;
|
4415 |
+
protected $childLinkType = 'Deconf_Service_Analytics_CustomDataSourceChildLink';
|
4416 |
protected $childLinkDataType = '';
|
4417 |
public $created;
|
4418 |
public $description;
|
4420 |
public $importBehavior;
|
4421 |
public $kind;
|
4422 |
public $name;
|
4423 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_CustomDataSourceParentLink';
|
4424 |
protected $parentLinkDataType = '';
|
4425 |
public $profilesLinked;
|
4426 |
public $selfLink;
|
4438 |
{
|
4439 |
return $this->accountId;
|
4440 |
}
|
4441 |
+
public function setChildLink(Deconf_Service_Analytics_CustomDataSourceChildLink $childLink)
|
4442 |
{
|
4443 |
$this->childLink = $childLink;
|
4444 |
}
|
4494 |
{
|
4495 |
return $this->name;
|
4496 |
}
|
4497 |
+
public function setParentLink(Deconf_Service_Analytics_CustomDataSourceParentLink $parentLink)
|
4498 |
{
|
4499 |
$this->parentLink = $parentLink;
|
4500 |
}
|
4552 |
}
|
4553 |
}
|
4554 |
|
4555 |
+
class Deconf_Service_Analytics_CustomDataSourceChildLink extends Deconf_Model
|
4556 |
{
|
4557 |
protected $internal_gapi_mappings = array(
|
4558 |
);
|
4578 |
}
|
4579 |
}
|
4580 |
|
4581 |
+
class Deconf_Service_Analytics_CustomDataSourceParentLink extends Deconf_Model
|
4582 |
{
|
4583 |
protected $internal_gapi_mappings = array(
|
4584 |
);
|
4604 |
}
|
4605 |
}
|
4606 |
|
4607 |
+
class Deconf_Service_Analytics_CustomDataSources extends Deconf_Collection
|
4608 |
{
|
4609 |
protected $collection_key = 'items';
|
4610 |
protected $internal_gapi_mappings = array(
|
4611 |
);
|
4612 |
+
protected $itemsType = 'Deconf_Service_Analytics_CustomDataSource';
|
4613 |
protected $itemsDataType = 'array';
|
4614 |
public $itemsPerPage;
|
4615 |
public $kind;
|
4686 |
}
|
4687 |
}
|
4688 |
|
4689 |
+
class Deconf_Service_Analytics_CustomDimension extends Deconf_Model
|
4690 |
{
|
4691 |
protected $internal_gapi_mappings = array(
|
4692 |
);
|
4697 |
public $index;
|
4698 |
public $kind;
|
4699 |
public $name;
|
4700 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_CustomDimensionParentLink';
|
4701 |
protected $parentLinkDataType = '';
|
4702 |
public $scope;
|
4703 |
public $selfLink;
|
4761 |
{
|
4762 |
return $this->name;
|
4763 |
}
|
4764 |
+
public function setParentLink(Deconf_Service_Analytics_CustomDimensionParentLink $parentLink)
|
4765 |
{
|
4766 |
$this->parentLink = $parentLink;
|
4767 |
}
|
4803 |
}
|
4804 |
}
|
4805 |
|
4806 |
+
class Deconf_Service_Analytics_CustomDimensionParentLink extends Deconf_Model
|
4807 |
{
|
4808 |
protected $internal_gapi_mappings = array(
|
4809 |
);
|
4829 |
}
|
4830 |
}
|
4831 |
|
4832 |
+
class Deconf_Service_Analytics_CustomDimensions extends Deconf_Collection
|
4833 |
{
|
4834 |
protected $collection_key = 'items';
|
4835 |
protected $internal_gapi_mappings = array(
|
4836 |
);
|
4837 |
+
protected $itemsType = 'Deconf_Service_Analytics_CustomDimension';
|
4838 |
protected $itemsDataType = 'array';
|
4839 |
public $itemsPerPage;
|
4840 |
public $kind;
|
4911 |
}
|
4912 |
}
|
4913 |
|
4914 |
+
class Deconf_Service_Analytics_CustomMetric extends Deconf_Model
|
4915 |
{
|
4916 |
protected $internal_gapi_mappings = array(
|
4917 |
"maxValue" => "max_value",
|
4926 |
public $maxValue;
|
4927 |
public $minValue;
|
4928 |
public $name;
|
4929 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_CustomMetricParentLink';
|
4930 |
protected $parentLinkDataType = '';
|
4931 |
public $scope;
|
4932 |
public $selfLink;
|
5007 |
{
|
5008 |
return $this->name;
|
5009 |
}
|
5010 |
+
public function setParentLink(Deconf_Service_Analytics_CustomMetricParentLink $parentLink)
|
5011 |
{
|
5012 |
$this->parentLink = $parentLink;
|
5013 |
}
|
5057 |
}
|
5058 |
}
|
5059 |
|
5060 |
+
class Deconf_Service_Analytics_CustomMetricParentLink extends Deconf_Model
|
5061 |
{
|
5062 |
protected $internal_gapi_mappings = array(
|
5063 |
);
|
5083 |
}
|
5084 |
}
|
5085 |
|
5086 |
+
class Deconf_Service_Analytics_CustomMetrics extends Deconf_Collection
|
5087 |
{
|
5088 |
protected $collection_key = 'items';
|
5089 |
protected $internal_gapi_mappings = array(
|
5090 |
);
|
5091 |
+
protected $itemsType = 'Deconf_Service_Analytics_CustomMetric';
|
5092 |
protected $itemsDataType = 'array';
|
5093 |
public $itemsPerPage;
|
5094 |
public $kind;
|
5165 |
}
|
5166 |
}
|
5167 |
|
5168 |
+
class Deconf_Service_Analytics_EntityAdWordsLink extends Deconf_Collection
|
5169 |
{
|
5170 |
protected $collection_key = 'profileIds';
|
5171 |
protected $internal_gapi_mappings = array(
|
5172 |
);
|
5173 |
+
protected $adWordsAccountsType = 'Deconf_Service_Analytics_AdWordsAccount';
|
5174 |
protected $adWordsAccountsDataType = 'array';
|
5175 |
+
protected $entityType = 'Deconf_Service_Analytics_EntityAdWordsLinkEntity';
|
5176 |
protected $entityDataType = '';
|
5177 |
public $id;
|
5178 |
public $kind;
|
5189 |
{
|
5190 |
return $this->adWordsAccounts;
|
5191 |
}
|
5192 |
+
public function setEntity(Deconf_Service_Analytics_EntityAdWordsLinkEntity $entity)
|
5193 |
{
|
5194 |
$this->entity = $entity;
|
5195 |
}
|
5239 |
}
|
5240 |
}
|
5241 |
|
5242 |
+
class Deconf_Service_Analytics_EntityAdWordsLinkEntity extends Deconf_Model
|
5243 |
{
|
5244 |
protected $internal_gapi_mappings = array(
|
5245 |
);
|
5246 |
+
protected $webPropertyRefType = 'Deconf_Service_Analytics_WebPropertyRef';
|
5247 |
protected $webPropertyRefDataType = '';
|
5248 |
|
5249 |
|
5250 |
+
public function setWebPropertyRef(Deconf_Service_Analytics_WebPropertyRef $webPropertyRef)
|
5251 |
{
|
5252 |
$this->webPropertyRef = $webPropertyRef;
|
5253 |
}
|
5257 |
}
|
5258 |
}
|
5259 |
|
5260 |
+
class Deconf_Service_Analytics_EntityAdWordsLinks extends Deconf_Collection
|
5261 |
{
|
5262 |
protected $collection_key = 'items';
|
5263 |
protected $internal_gapi_mappings = array(
|
5264 |
);
|
5265 |
+
protected $itemsType = 'Deconf_Service_Analytics_EntityAdWordsLink';
|
5266 |
protected $itemsDataType = 'array';
|
5267 |
public $itemsPerPage;
|
5268 |
public $kind;
|
5330 |
}
|
5331 |
}
|
5332 |
|
5333 |
+
class Deconf_Service_Analytics_EntityUserLink extends Deconf_Model
|
5334 |
{
|
5335 |
protected $internal_gapi_mappings = array(
|
5336 |
);
|
5337 |
+
protected $entityType = 'Deconf_Service_Analytics_EntityUserLinkEntity';
|
5338 |
protected $entityDataType = '';
|
5339 |
public $id;
|
5340 |
public $kind;
|
5341 |
+
protected $permissionsType = 'Deconf_Service_Analytics_EntityUserLinkPermissions';
|
5342 |
protected $permissionsDataType = '';
|
5343 |
public $selfLink;
|
5344 |
+
protected $userRefType = 'Deconf_Service_Analytics_UserRef';
|
5345 |
protected $userRefDataType = '';
|
5346 |
|
5347 |
|
5348 |
+
public function setEntity(Deconf_Service_Analytics_EntityUserLinkEntity $entity)
|
5349 |
{
|
5350 |
$this->entity = $entity;
|
5351 |
}
|
5369 |
{
|
5370 |
return $this->kind;
|
5371 |
}
|
5372 |
+
public function setPermissions(Deconf_Service_Analytics_EntityUserLinkPermissions $permissions)
|
5373 |
{
|
5374 |
$this->permissions = $permissions;
|
5375 |
}
|
5385 |
{
|
5386 |
return $this->selfLink;
|
5387 |
}
|
5388 |
+
public function setUserRef(Deconf_Service_Analytics_UserRef $userRef)
|
5389 |
{
|
5390 |
$this->userRef = $userRef;
|
5391 |
}
|
5395 |
}
|
5396 |
}
|
5397 |
|
5398 |
+
class Deconf_Service_Analytics_EntityUserLinkEntity extends Deconf_Model
|
5399 |
{
|
5400 |
protected $internal_gapi_mappings = array(
|
5401 |
);
|
5402 |
+
protected $accountRefType = 'Deconf_Service_Analytics_AccountRef';
|
5403 |
protected $accountRefDataType = '';
|
5404 |
+
protected $profileRefType = 'Deconf_Service_Analytics_ProfileRef';
|
5405 |
protected $profileRefDataType = '';
|
5406 |
+
protected $webPropertyRefType = 'Deconf_Service_Analytics_WebPropertyRef';
|
5407 |
protected $webPropertyRefDataType = '';
|
5408 |
|
5409 |
|
5410 |
+
public function setAccountRef(Deconf_Service_Analytics_AccountRef $accountRef)
|
5411 |
{
|
5412 |
$this->accountRef = $accountRef;
|
5413 |
}
|
5415 |
{
|
5416 |
return $this->accountRef;
|
5417 |
}
|
5418 |
+
public function setProfileRef(Deconf_Service_Analytics_ProfileRef $profileRef)
|
5419 |
{
|
5420 |
$this->profileRef = $profileRef;
|
5421 |
}
|
5423 |
{
|
5424 |
return $this->profileRef;
|
5425 |
}
|
5426 |
+
public function setWebPropertyRef(Deconf_Service_Analytics_WebPropertyRef $webPropertyRef)
|
5427 |
{
|
5428 |
$this->webPropertyRef = $webPropertyRef;
|
5429 |
}
|
5433 |
}
|
5434 |
}
|
5435 |
|
5436 |
+
class Deconf_Service_Analytics_EntityUserLinkPermissions extends Deconf_Collection
|
5437 |
{
|
5438 |
protected $collection_key = 'local';
|
5439 |
protected $internal_gapi_mappings = array(
|
5460 |
}
|
5461 |
}
|
5462 |
|
5463 |
+
class Deconf_Service_Analytics_EntityUserLinks extends Deconf_Collection
|
5464 |
{
|
5465 |
protected $collection_key = 'items';
|
5466 |
protected $internal_gapi_mappings = array(
|
5467 |
);
|
5468 |
+
protected $itemsType = 'Deconf_Service_Analytics_EntityUserLink';
|
5469 |
protected $itemsDataType = 'array';
|
5470 |
public $itemsPerPage;
|
5471 |
public $kind;
|
5533 |
}
|
5534 |
}
|
5535 |
|
5536 |
+
class Deconf_Service_Analytics_Experiment extends Deconf_Collection
|
5537 |
{
|
5538 |
protected $collection_key = 'variations';
|
5539 |
protected $internal_gapi_mappings = array(
|
5551 |
public $name;
|
5552 |
public $objectiveMetric;
|
5553 |
public $optimizationType;
|
5554 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_ExperimentParentLink';
|
5555 |
protected $parentLinkDataType = '';
|
5556 |
public $profileId;
|
5557 |
public $reasonExperimentEnded;
|
5563 |
public $status;
|
5564 |
public $trafficCoverage;
|
5565 |
public $updated;
|
5566 |
+
protected $variationsType = 'Deconf_Service_Analytics_ExperimentVariations';
|
5567 |
protected $variationsDataType = 'array';
|
5568 |
public $webPropertyId;
|
5569 |
public $winnerConfidenceLevel;
|
5674 |
{
|
5675 |
return $this->optimizationType;
|
5676 |
}
|
5677 |
+
public function setParentLink(Deconf_Service_Analytics_ExperimentParentLink $parentLink)
|
5678 |
{
|
5679 |
$this->parentLink = $parentLink;
|
5680 |
}
|
5796 |
}
|
5797 |
}
|
5798 |
|
5799 |
+
class Deconf_Service_Analytics_ExperimentParentLink extends Deconf_Model
|
5800 |
{
|
5801 |
protected $internal_gapi_mappings = array(
|
5802 |
);
|
5822 |
}
|
5823 |
}
|
5824 |
|
5825 |
+
class Deconf_Service_Analytics_ExperimentVariations extends Deconf_Model
|
5826 |
{
|
5827 |
protected $internal_gapi_mappings = array(
|
5828 |
);
|
5875 |
}
|
5876 |
}
|
5877 |
|
5878 |
+
class Deconf_Service_Analytics_Experiments extends Deconf_Collection
|
5879 |
{
|
5880 |
protected $collection_key = 'items';
|
5881 |
protected $internal_gapi_mappings = array(
|
5882 |
);
|
5883 |
+
protected $itemsType = 'Deconf_Service_Analytics_Experiment';
|
5884 |
protected $itemsDataType = 'array';
|
5885 |
public $itemsPerPage;
|
5886 |
public $kind;
|
5957 |
}
|
5958 |
}
|
5959 |
|
5960 |
+
class Deconf_Service_Analytics_Filter extends Deconf_Model
|
5961 |
{
|
5962 |
protected $internal_gapi_mappings = array(
|
5963 |
);
|
5964 |
public $accountId;
|
5965 |
+
protected $advancedDetailsType = 'Deconf_Service_Analytics_FilterAdvancedDetails';
|
5966 |
protected $advancedDetailsDataType = '';
|
5967 |
public $created;
|
5968 |
+
protected $excludeDetailsType = 'Deconf_Service_Analytics_FilterExpression';
|
5969 |
protected $excludeDetailsDataType = '';
|
5970 |
public $id;
|
5971 |
+
protected $includeDetailsType = 'Deconf_Service_Analytics_FilterExpression';
|
5972 |
protected $includeDetailsDataType = '';
|
5973 |
public $kind;
|
5974 |
+
protected $lowercaseDetailsType = 'Deconf_Service_Analytics_FilterLowercaseDetails';
|
5975 |
protected $lowercaseDetailsDataType = '';
|
5976 |
public $name;
|
5977 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_FilterParentLink';
|
5978 |
protected $parentLinkDataType = '';
|
5979 |
+
protected $searchAndReplaceDetailsType = 'Deconf_Service_Analytics_FilterSearchAndReplaceDetails';
|
5980 |
protected $searchAndReplaceDetailsDataType = '';
|
5981 |
public $selfLink;
|
5982 |
public $type;
|
5983 |
public $updated;
|
5984 |
+
protected $uppercaseDetailsType = 'Deconf_Service_Analytics_FilterUppercaseDetails';
|
5985 |
protected $uppercaseDetailsDataType = '';
|
5986 |
|
5987 |
|
5993 |
{
|
5994 |
return $this->accountId;
|
5995 |
}
|
5996 |
+
public function setAdvancedDetails(Deconf_Service_Analytics_FilterAdvancedDetails $advancedDetails)
|
5997 |
{
|
5998 |
$this->advancedDetails = $advancedDetails;
|
5999 |
}
|
6009 |
{
|
6010 |
return $this->created;
|
6011 |
}
|
6012 |
+
public function setExcludeDetails(Deconf_Service_Analytics_FilterExpression $excludeDetails)
|
6013 |
{
|
6014 |
$this->excludeDetails = $excludeDetails;
|
6015 |
}
|
6025 |
{
|
6026 |
return $this->id;
|
6027 |
}
|
6028 |
+
public function setIncludeDetails(Deconf_Service_Analytics_FilterExpression $includeDetails)
|
6029 |
{
|
6030 |
$this->includeDetails = $includeDetails;
|
6031 |
}
|
6041 |
{
|
6042 |
return $this->kind;
|
6043 |
}
|
6044 |
+
public function setLowercaseDetails(Deconf_Service_Analytics_FilterLowercaseDetails $lowercaseDetails)
|
6045 |
{
|
6046 |
$this->lowercaseDetails = $lowercaseDetails;
|
6047 |
}
|
6057 |
{
|
6058 |
return $this->name;
|
6059 |
}
|
6060 |
+
public function setParentLink(Deconf_Service_Analytics_FilterParentLink $parentLink)
|
6061 |
{
|
6062 |
$this->parentLink = $parentLink;
|
6063 |
}
|
6065 |
{
|
6066 |
return $this->parentLink;
|
6067 |
}
|
6068 |
+
public function setSearchAndReplaceDetails(Deconf_Service_Analytics_FilterSearchAndReplaceDetails $searchAndReplaceDetails)
|
6069 |
{
|
6070 |
$this->searchAndReplaceDetails = $searchAndReplaceDetails;
|
6071 |
}
|
6097 |
{
|
6098 |
return $this->updated;
|
6099 |
}
|
6100 |
+
public function setUppercaseDetails(Deconf_Service_Analytics_FilterUppercaseDetails $uppercaseDetails)
|
6101 |
{
|
6102 |
$this->uppercaseDetails = $uppercaseDetails;
|
6103 |
}
|
6107 |
}
|
6108 |
}
|
6109 |
|
6110 |
+
class Deconf_Service_Analytics_FilterAdvancedDetails extends Deconf_Model
|
6111 |
{
|
6112 |
protected $internal_gapi_mappings = array(
|
6113 |
);
|
6232 |
}
|
6233 |
}
|
6234 |
|
6235 |
+
class Deconf_Service_Analytics_FilterExpression extends Deconf_Model
|
6236 |
{
|
6237 |
protected $internal_gapi_mappings = array(
|
6238 |
);
|
6294 |
}
|
6295 |
}
|
6296 |
|
6297 |
+
class Deconf_Service_Analytics_FilterLowercaseDetails extends Deconf_Model
|
6298 |
{
|
6299 |
protected $internal_gapi_mappings = array(
|
6300 |
);
|
6320 |
}
|
6321 |
}
|
6322 |
|
6323 |
+
class Deconf_Service_Analytics_FilterParentLink extends Deconf_Model
|
6324 |
{
|
6325 |
protected $internal_gapi_mappings = array(
|
6326 |
);
|
6346 |
}
|
6347 |
}
|
6348 |
|
6349 |
+
class Deconf_Service_Analytics_FilterRef extends Deconf_Model
|
6350 |
{
|
6351 |
protected $internal_gapi_mappings = array(
|
6352 |
);
|
6399 |
}
|
6400 |
}
|
6401 |
|
6402 |
+
class Deconf_Service_Analytics_FilterSearchAndReplaceDetails extends Deconf_Model
|
6403 |
{
|
6404 |
protected $internal_gapi_mappings = array(
|
6405 |
);
|
6452 |
}
|
6453 |
}
|
6454 |
|
6455 |
+
class Deconf_Service_Analytics_FilterUppercaseDetails extends Deconf_Model
|
6456 |
{
|
6457 |
protected $internal_gapi_mappings = array(
|
6458 |
);
|
6478 |
}
|
6479 |
}
|
6480 |
|
6481 |
+
class Deconf_Service_Analytics_Filters extends Deconf_Collection
|
6482 |
{
|
6483 |
protected $collection_key = 'items';
|
6484 |
protected $internal_gapi_mappings = array(
|
6485 |
);
|
6486 |
+
protected $itemsType = 'Deconf_Service_Analytics_Filter';
|
6487 |
protected $itemsDataType = 'array';
|
6488 |
public $itemsPerPage;
|
6489 |
public $kind;
|
6560 |
}
|
6561 |
}
|
6562 |
|
6563 |
+
class Deconf_Service_Analytics_GaData extends Deconf_Collection
|
6564 |
{
|
6565 |
protected $collection_key = 'rows';
|
6566 |
protected $internal_gapi_mappings = array(
|
6567 |
);
|
6568 |
+
protected $columnHeadersType = 'Deconf_Service_Analytics_GaDataColumnHeaders';
|
6569 |
protected $columnHeadersDataType = 'array';
|
6570 |
public $containsSampledData;
|
6571 |
+
protected $dataTableType = 'Deconf_Service_Analytics_GaDataDataTable';
|
6572 |
protected $dataTableDataType = '';
|
6573 |
public $id;
|
6574 |
public $itemsPerPage;
|
6575 |
public $kind;
|
6576 |
public $nextLink;
|
6577 |
public $previousLink;
|
6578 |
+
protected $profileInfoType = 'Deconf_Service_Analytics_GaDataProfileInfo';
|
6579 |
protected $profileInfoDataType = '';
|
6580 |
+
protected $queryType = 'Deconf_Service_Analytics_GaDataQuery';
|
6581 |
protected $queryDataType = '';
|
6582 |
public $rows;
|
6583 |
public $sampleSize;
|
6603 |
{
|
6604 |
return $this->containsSampledData;
|
6605 |
}
|
6606 |
+
public function setDataTable(Deconf_Service_Analytics_GaDataDataTable $dataTable)
|
6607 |
{
|
6608 |
$this->dataTable = $dataTable;
|
6609 |
}
|
6651 |
{
|
6652 |
return $this->previousLink;
|
6653 |
}
|
6654 |
+
public function setProfileInfo(Deconf_Service_Analytics_GaDataProfileInfo $profileInfo)
|
6655 |
{
|
6656 |
$this->profileInfo = $profileInfo;
|
6657 |
}
|
6659 |
{
|
6660 |
return $this->profileInfo;
|
6661 |
}
|
6662 |
+
public function setQuery(Deconf_Service_Analytics_GaDataQuery $query)
|
6663 |
{
|
6664 |
$this->query = $query;
|
6665 |
}
|
6717 |
}
|
6718 |
}
|
6719 |
|
6720 |
+
class Deconf_Service_Analytics_GaDataColumnHeaders extends Deconf_Model
|
6721 |
{
|
6722 |
protected $internal_gapi_mappings = array(
|
6723 |
);
|
6752 |
}
|
6753 |
}
|
6754 |
|
6755 |
+
class Deconf_Service_Analytics_GaDataDataTable extends Deconf_Collection
|
6756 |
{
|
6757 |
protected $collection_key = 'rows';
|
6758 |
protected $internal_gapi_mappings = array(
|
6759 |
);
|
6760 |
+
protected $colsType = 'Deconf_Service_Analytics_GaDataDataTableCols';
|
6761 |
protected $colsDataType = 'array';
|
6762 |
+
protected $rowsType = 'Deconf_Service_Analytics_GaDataDataTableRows';
|
6763 |
protected $rowsDataType = 'array';
|
6764 |
|
6765 |
|
6781 |
}
|
6782 |
}
|
6783 |
|
6784 |
+
class Deconf_Service_Analytics_GaDataDataTableCols extends Deconf_Model
|
6785 |
{
|
6786 |
protected $internal_gapi_mappings = array(
|
6787 |
);
|
6816 |
}
|
6817 |
}
|
6818 |
|
6819 |
+
class Deconf_Service_Analytics_GaDataDataTableRows extends Deconf_Collection
|
6820 |
{
|
6821 |
protected $collection_key = 'c';
|
6822 |
protected $internal_gapi_mappings = array(
|
6823 |
);
|
6824 |
+
protected $cType = 'Deconf_Service_Analytics_GaDataDataTableRowsC';
|
6825 |
protected $cDataType = 'array';
|
6826 |
|
6827 |
|
6835 |
}
|
6836 |
}
|
6837 |
|
6838 |
+
class Deconf_Service_Analytics_GaDataDataTableRowsC extends Deconf_Model
|
6839 |
{
|
6840 |
protected $internal_gapi_mappings = array(
|
6841 |
);
|
6852 |
}
|
6853 |
}
|
6854 |
|
6855 |
+
class Deconf_Service_Analytics_GaDataProfileInfo extends Deconf_Model
|
6856 |
{
|
6857 |
protected $internal_gapi_mappings = array(
|
6858 |
);
|
6914 |
}
|
6915 |
}
|
6916 |
|
6917 |
+
class Deconf_Service_Analytics_GaDataQuery extends Deconf_Collection
|
6918 |
{
|
6919 |
protected $collection_key = 'sort';
|
6920 |
protected $internal_gapi_mappings = array(
|
7026 |
}
|
7027 |
}
|
7028 |
|
7029 |
+
class Deconf_Service_Analytics_Goal extends Deconf_Model
|
7030 |
{
|
7031 |
protected $internal_gapi_mappings = array(
|
7032 |
);
|
7033 |
public $accountId;
|
7034 |
public $active;
|
7035 |
public $created;
|
7036 |
+
protected $eventDetailsType = 'Deconf_Service_Analytics_GoalEventDetails';
|
7037 |
protected $eventDetailsDataType = '';
|
7038 |
public $id;
|
7039 |
public $internalWebPropertyId;
|
7040 |
public $kind;
|
7041 |
public $name;
|
7042 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_GoalParentLink';
|
7043 |
protected $parentLinkDataType = '';
|
7044 |
public $profileId;
|
7045 |
public $selfLink;
|
7046 |
public $type;
|
7047 |
public $updated;
|
7048 |
+
protected $urlDestinationDetailsType = 'Deconf_Service_Analytics_GoalUrlDestinationDetails';
|
7049 |
protected $urlDestinationDetailsDataType = '';
|
7050 |
public $value;
|
7051 |
+
protected $visitNumPagesDetailsType = 'Deconf_Service_Analytics_GoalVisitNumPagesDetails';
|
7052 |
protected $visitNumPagesDetailsDataType = '';
|
7053 |
+
protected $visitTimeOnSiteDetailsType = 'Deconf_Service_Analytics_GoalVisitTimeOnSiteDetails';
|
7054 |
protected $visitTimeOnSiteDetailsDataType = '';
|
7055 |
public $webPropertyId;
|
7056 |
|
7079 |
{
|
7080 |
return $this->created;
|
7081 |
}
|
7082 |
+
public function setEventDetails(Deconf_Service_Analytics_GoalEventDetails $eventDetails)
|
7083 |
{
|
7084 |
$this->eventDetails = $eventDetails;
|
7085 |
}
|
7119 |
{
|
7120 |
return $this->name;
|
7121 |
}
|
7122 |
+
public function setParentLink(Deconf_Service_Analytics_GoalParentLink $parentLink)
|
7123 |
{
|
7124 |
$this->parentLink = $parentLink;
|
7125 |
}
|
7159 |
{
|
7160 |
return $this->updated;
|
7161 |
}
|
7162 |
+
public function setUrlDestinationDetails(Deconf_Service_Analytics_GoalUrlDestinationDetails $urlDestinationDetails)
|
7163 |
{
|
7164 |
$this->urlDestinationDetails = $urlDestinationDetails;
|
7165 |
}
|
7175 |
{
|
7176 |
return $this->value;
|
7177 |
}
|
7178 |
+
public function setVisitNumPagesDetails(Deconf_Service_Analytics_GoalVisitNumPagesDetails $visitNumPagesDetails)
|
7179 |
{
|
7180 |
$this->visitNumPagesDetails = $visitNumPagesDetails;
|
7181 |
}
|
7183 |
{
|
7184 |
return $this->visitNumPagesDetails;
|
7185 |
}
|
7186 |
+
public function setVisitTimeOnSiteDetails(Deconf_Service_Analytics_GoalVisitTimeOnSiteDetails $visitTimeOnSiteDetails)
|
7187 |
{
|
7188 |
$this->visitTimeOnSiteDetails = $visitTimeOnSiteDetails;
|
7189 |
}
|
7201 |
}
|
7202 |
}
|
7203 |
|
7204 |
+
class Deconf_Service_Analytics_GoalEventDetails extends Deconf_Collection
|
7205 |
{
|
7206 |
protected $collection_key = 'eventConditions';
|
7207 |
protected $internal_gapi_mappings = array(
|
7208 |
);
|
7209 |
+
protected $eventConditionsType = 'Deconf_Service_Analytics_GoalEventDetailsEventConditions';
|
7210 |
protected $eventConditionsDataType = 'array';
|
7211 |
public $useEventValue;
|
7212 |
|
7229 |
}
|
7230 |
}
|
7231 |
|
7232 |
+
class Deconf_Service_Analytics_GoalEventDetailsEventConditions extends Deconf_Model
|
7233 |
{
|
7234 |
protected $internal_gapi_mappings = array(
|
7235 |
);
|
7282 |
}
|
7283 |
}
|
7284 |
|
7285 |
+
class Deconf_Service_Analytics_GoalParentLink extends Deconf_Model
|
7286 |
{
|
7287 |
protected $internal_gapi_mappings = array(
|
7288 |
);
|
7308 |
}
|
7309 |
}
|
7310 |
|
7311 |
+
class Deconf_Service_Analytics_GoalUrlDestinationDetails extends Deconf_Collection
|
7312 |
{
|
7313 |
protected $collection_key = 'steps';
|
7314 |
protected $internal_gapi_mappings = array(
|
7316 |
public $caseSensitive;
|
7317 |
public $firstStepRequired;
|
7318 |
public $matchType;
|
7319 |
+
protected $stepsType = 'Deconf_Service_Analytics_GoalUrlDestinationDetailsSteps';
|
7320 |
protected $stepsDataType = 'array';
|
7321 |
public $url;
|
7322 |
|
7363 |
}
|
7364 |
}
|
7365 |
|
7366 |
+
class Deconf_Service_Analytics_GoalUrlDestinationDetailsSteps extends Deconf_Model
|
7367 |
{
|
7368 |
protected $internal_gapi_mappings = array(
|
7369 |
);
|
7398 |
}
|
7399 |
}
|
7400 |
|
7401 |
+
class Deconf_Service_Analytics_GoalVisitNumPagesDetails extends Deconf_Model
|
7402 |
{
|
7403 |
protected $internal_gapi_mappings = array(
|
7404 |
);
|
7424 |
}
|
7425 |
}
|
7426 |
|
7427 |
+
class Deconf_Service_Analytics_GoalVisitTimeOnSiteDetails extends Deconf_Model
|
7428 |
{
|
7429 |
protected $internal_gapi_mappings = array(
|
7430 |
);
|
7450 |
}
|
7451 |
}
|
7452 |
|
7453 |
+
class Deconf_Service_Analytics_Goals extends Deconf_Collection
|
7454 |
{
|
7455 |
protected $collection_key = 'items';
|
7456 |
protected $internal_gapi_mappings = array(
|
7457 |
);
|
7458 |
+
protected $itemsType = 'Deconf_Service_Analytics_Goal';
|
7459 |
protected $itemsDataType = 'array';
|
7460 |
public $itemsPerPage;
|
7461 |
public $kind;
|
7532 |
}
|
7533 |
}
|
7534 |
|
7535 |
+
class Deconf_Service_Analytics_McfData extends Deconf_Collection
|
7536 |
{
|
7537 |
protected $collection_key = 'rows';
|
7538 |
protected $internal_gapi_mappings = array(
|
7539 |
);
|
7540 |
+
protected $columnHeadersType = 'Deconf_Service_Analytics_McfDataColumnHeaders';
|
7541 |
protected $columnHeadersDataType = 'array';
|
7542 |
public $containsSampledData;
|
7543 |
public $id;
|
7545 |
public $kind;
|
7546 |
public $nextLink;
|
7547 |
public $previousLink;
|
7548 |
+
protected $profileInfoType = 'Deconf_Service_Analytics_McfDataProfileInfo';
|
7549 |
protected $profileInfoDataType = '';
|
7550 |
+
protected $queryType = 'Deconf_Service_Analytics_McfDataQuery';
|
7551 |
protected $queryDataType = '';
|
7552 |
+
protected $rowsType = 'Deconf_Service_Analytics_McfDataRows';
|
7553 |
protected $rowsDataType = 'array';
|
7554 |
public $sampleSize;
|
7555 |
public $sampleSpace;
|
7614 |
{
|
7615 |
return $this->previousLink;
|
7616 |
}
|
7617 |
+
public function setProfileInfo(Deconf_Service_Analytics_McfDataProfileInfo $profileInfo)
|
7618 |
{
|
7619 |
$this->profileInfo = $profileInfo;
|
7620 |
}
|
7622 |
{
|
7623 |
return $this->profileInfo;
|
7624 |
}
|
7625 |
+
public function setQuery(Deconf_Service_Analytics_McfDataQuery $query)
|
7626 |
{
|
7627 |
$this->query = $query;
|
7628 |
}
|
7680 |
}
|
7681 |
}
|
7682 |
|
7683 |
+
class Deconf_Service_Analytics_McfDataColumnHeaders extends Deconf_Model
|
7684 |
{
|
7685 |
protected $internal_gapi_mappings = array(
|
7686 |
);
|
7715 |
}
|
7716 |
}
|
7717 |
|
7718 |
+
class Deconf_Service_Analytics_McfDataProfileInfo extends Deconf_Model
|
7719 |
{
|
7720 |
protected $internal_gapi_mappings = array(
|
7721 |
);
|
7777 |
}
|
7778 |
}
|
7779 |
|
7780 |
+
class Deconf_Service_Analytics_McfDataQuery extends Deconf_Collection
|
7781 |
{
|
7782 |
protected $collection_key = 'sort';
|
7783 |
protected $internal_gapi_mappings = array(
|
7889 |
}
|
7890 |
}
|
7891 |
|
7892 |
+
class Deconf_Service_Analytics_McfDataRows extends Deconf_Collection
|
7893 |
{
|
7894 |
protected $collection_key = 'conversionPathValue';
|
7895 |
protected $internal_gapi_mappings = array(
|
7896 |
);
|
7897 |
+
protected $conversionPathValueType = 'Deconf_Service_Analytics_McfDataRowsConversionPathValue';
|
7898 |
protected $conversionPathValueDataType = 'array';
|
7899 |
public $primitiveValue;
|
7900 |
|
7917 |
}
|
7918 |
}
|
7919 |
|
7920 |
+
class Deconf_Service_Analytics_McfDataRowsConversionPathValue extends Deconf_Model
|
7921 |
{
|
7922 |
protected $internal_gapi_mappings = array(
|
7923 |
);
|
7943 |
}
|
7944 |
}
|
7945 |
|
7946 |
+
class Deconf_Service_Analytics_Profile extends Deconf_Model
|
7947 |
{
|
7948 |
protected $internal_gapi_mappings = array(
|
7949 |
);
|
7950 |
public $accountId;
|
7951 |
public $botFilteringEnabled;
|
7952 |
+
protected $childLinkType = 'Deconf_Service_Analytics_ProfileChildLink';
|
7953 |
protected $childLinkDataType = '';
|
7954 |
public $created;
|
7955 |
public $currency;
|
7961 |
public $internalWebPropertyId;
|
7962 |
public $kind;
|
7963 |
public $name;
|
7964 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_ProfileParentLink';
|
7965 |
protected $parentLinkDataType = '';
|
7966 |
+
protected $permissionsType = 'Deconf_Service_Analytics_ProfilePermissions';
|
7967 |
protected $permissionsDataType = '';
|
7968 |
public $selfLink;
|
7969 |
public $siteSearchCategoryParameters;
|
7993 |
{
|
7994 |
return $this->botFilteringEnabled;
|
7995 |
}
|
7996 |
+
public function setChildLink(Deconf_Service_Analytics_ProfileChildLink $childLink)
|
7997 |
{
|
7998 |
$this->childLink = $childLink;
|
7999 |
}
|
8081 |
{
|
8082 |
return $this->name;
|
8083 |
}
|
8084 |
+
public function setParentLink(Deconf_Service_Analytics_ProfileParentLink $parentLink)
|
8085 |
{
|
8086 |
$this->parentLink = $parentLink;
|
8087 |
}
|
8089 |
{
|
8090 |
return $this->parentLink;
|
8091 |
}
|
8092 |
+
public function setPermissions(Deconf_Service_Analytics_ProfilePermissions $permissions)
|
8093 |
{
|
8094 |
$this->permissions = $permissions;
|
8095 |
}
|
8179 |
}
|
8180 |
}
|
8181 |
|
8182 |
+
class Deconf_Service_Analytics_ProfileChildLink extends Deconf_Model
|
8183 |
{
|
8184 |
protected $internal_gapi_mappings = array(
|
8185 |
);
|
8205 |
}
|
8206 |
}
|
8207 |
|
8208 |
+
class Deconf_Service_Analytics_ProfileFilterLink extends Deconf_Model
|
8209 |
{
|
8210 |
protected $internal_gapi_mappings = array(
|
8211 |
);
|
8212 |
+
protected $filterRefType = 'Deconf_Service_Analytics_FilterRef';
|
8213 |
protected $filterRefDataType = '';
|
8214 |
public $id;
|
8215 |
public $kind;
|
8216 |
+
protected $profileRefType = 'Deconf_Service_Analytics_ProfileRef';
|
8217 |
protected $profileRefDataType = '';
|
8218 |
public $rank;
|
8219 |
public $selfLink;
|
8220 |
|
8221 |
|
8222 |
+
public function setFilterRef(Deconf_Service_Analytics_FilterRef $filterRef)
|
8223 |
{
|
8224 |
$this->filterRef = $filterRef;
|
8225 |
}
|
8243 |
{
|
8244 |
return $this->kind;
|
8245 |
}
|
8246 |
+
public function setProfileRef(Deconf_Service_Analytics_ProfileRef $profileRef)
|
8247 |
{
|
8248 |
$this->profileRef = $profileRef;
|
8249 |
}
|
8269 |
}
|
8270 |
}
|
8271 |
|
8272 |
+
class Deconf_Service_Analytics_ProfileFilterLinks extends Deconf_Collection
|
8273 |
{
|
8274 |
protected $collection_key = 'items';
|
8275 |
protected $internal_gapi_mappings = array(
|
8276 |
);
|
8277 |
+
protected $itemsType = 'Deconf_Service_Analytics_ProfileFilterLink';
|
8278 |
protected $itemsDataType = 'array';
|
8279 |
public $itemsPerPage;
|
8280 |
public $kind;
|
8351 |
}
|
8352 |
}
|
8353 |
|
8354 |
+
class Deconf_Service_Analytics_ProfileParentLink extends Deconf_Model
|
8355 |
{
|
8356 |
protected $internal_gapi_mappings = array(
|
8357 |
);
|
8377 |
}
|
8378 |
}
|
8379 |
|
8380 |
+
class Deconf_Service_Analytics_ProfilePermissions extends Deconf_Collection
|
8381 |
{
|
8382 |
protected $collection_key = 'effective';
|
8383 |
protected $internal_gapi_mappings = array(
|
8395 |
}
|
8396 |
}
|
8397 |
|
8398 |
+
class Deconf_Service_Analytics_ProfileRef extends Deconf_Model
|
8399 |
{
|
8400 |
protected $internal_gapi_mappings = array(
|
8401 |
);
|
8466 |
}
|
8467 |
}
|
8468 |
|
8469 |
+
class Deconf_Service_Analytics_ProfileSummary extends Deconf_Model
|
8470 |
{
|
8471 |
protected $internal_gapi_mappings = array(
|
8472 |
);
|
8510 |
}
|
8511 |
}
|
8512 |
|
8513 |
+
class Deconf_Service_Analytics_Profiles extends Deconf_Collection
|
8514 |
{
|
8515 |
protected $collection_key = 'items';
|
8516 |
protected $internal_gapi_mappings = array(
|
8517 |
);
|
8518 |
+
protected $itemsType = 'Deconf_Service_Analytics_Profile';
|
8519 |
protected $itemsDataType = 'array';
|
8520 |
public $itemsPerPage;
|
8521 |
public $kind;
|
8592 |
}
|
8593 |
}
|
8594 |
|
8595 |
+
class Deconf_Service_Analytics_RealtimeData extends Deconf_Collection
|
8596 |
{
|
8597 |
protected $collection_key = 'rows';
|
8598 |
protected $internal_gapi_mappings = array(
|
8599 |
);
|
8600 |
+
protected $columnHeadersType = 'Deconf_Service_Analytics_RealtimeDataColumnHeaders';
|
8601 |
protected $columnHeadersDataType = 'array';
|
8602 |
public $id;
|
8603 |
public $kind;
|
8604 |
+
protected $profileInfoType = 'Deconf_Service_Analytics_RealtimeDataProfileInfo';
|
8605 |
protected $profileInfoDataType = '';
|
8606 |
+
protected $queryType = 'Deconf_Service_Analytics_RealtimeDataQuery';
|
8607 |
protected $queryDataType = '';
|
8608 |
public $rows;
|
8609 |
public $selfLink;
|
8635 |
{
|
8636 |
return $this->kind;
|
8637 |
}
|
8638 |
+
public function setProfileInfo(Deconf_Service_Analytics_RealtimeDataProfileInfo $profileInfo)
|
8639 |
{
|
8640 |
$this->profileInfo = $profileInfo;
|
8641 |
}
|
8643 |
{
|
8644 |
return $this->profileInfo;
|
8645 |
}
|
8646 |
+
public function setQuery(Deconf_Service_Analytics_RealtimeDataQuery $query)
|
8647 |
{
|
8648 |
$this->query = $query;
|
8649 |
}
|
8685 |
}
|
8686 |
}
|
8687 |
|
8688 |
+
class Deconf_Service_Analytics_RealtimeDataColumnHeaders extends Deconf_Model
|
8689 |
{
|
8690 |
protected $internal_gapi_mappings = array(
|
8691 |
);
|
8720 |
}
|
8721 |
}
|
8722 |
|
8723 |
+
class Deconf_Service_Analytics_RealtimeDataProfileInfo extends Deconf_Model
|
8724 |
{
|
8725 |
protected $internal_gapi_mappings = array(
|
8726 |
);
|
8782 |
}
|
8783 |
}
|
8784 |
|
8785 |
+
class Deconf_Service_Analytics_RealtimeDataQuery extends Deconf_Collection
|
8786 |
{
|
8787 |
protected $collection_key = 'sort';
|
8788 |
protected $internal_gapi_mappings = array(
|
8846 |
}
|
8847 |
}
|
8848 |
|
8849 |
+
class Deconf_Service_Analytics_Segment extends Deconf_Model
|
8850 |
{
|
8851 |
protected $internal_gapi_mappings = array(
|
8852 |
);
|
8935 |
}
|
8936 |
}
|
8937 |
|
8938 |
+
class Deconf_Service_Analytics_Segments extends Deconf_Collection
|
8939 |
{
|
8940 |
protected $collection_key = 'items';
|
8941 |
protected $internal_gapi_mappings = array(
|
8942 |
);
|
8943 |
+
protected $itemsType = 'Deconf_Service_Analytics_Segment';
|
8944 |
protected $itemsDataType = 'array';
|
8945 |
public $itemsPerPage;
|
8946 |
public $kind;
|
9017 |
}
|
9018 |
}
|
9019 |
|
9020 |
+
class Deconf_Service_Analytics_UnsampledReport extends Deconf_Model
|
9021 |
{
|
9022 |
protected $internal_gapi_mappings = array(
|
9023 |
"endDate" => "end-date",
|
9024 |
"startDate" => "start-date",
|
9025 |
);
|
9026 |
public $accountId;
|
9027 |
+
protected $cloudStorageDownloadDetailsType = 'Deconf_Service_Analytics_UnsampledReportCloudStorageDownloadDetails';
|
9028 |
protected $cloudStorageDownloadDetailsDataType = '';
|
9029 |
public $created;
|
9030 |
public $dimensions;
|
9031 |
public $downloadType;
|
9032 |
+
protected $driveDownloadDetailsType = 'Deconf_Service_Analytics_UnsampledReportDriveDownloadDetails';
|
9033 |
protected $driveDownloadDetailsDataType = '';
|
9034 |
public $endDate;
|
9035 |
public $filters;
|
9054 |
{
|
9055 |
return $this->accountId;
|
9056 |
}
|
9057 |
+
public function setCloudStorageDownloadDetails(Deconf_Service_Analytics_UnsampledReportCloudStorageDownloadDetails $cloudStorageDownloadDetails)
|
9058 |
{
|
9059 |
$this->cloudStorageDownloadDetails = $cloudStorageDownloadDetails;
|
9060 |
}
|
9086 |
{
|
9087 |
return $this->downloadType;
|
9088 |
}
|
9089 |
+
public function setDriveDownloadDetails(Deconf_Service_Analytics_UnsampledReportDriveDownloadDetails $driveDownloadDetails)
|
9090 |
{
|
9091 |
$this->driveDownloadDetails = $driveDownloadDetails;
|
9092 |
}
|
9200 |
}
|
9201 |
}
|
9202 |
|
9203 |
+
class Deconf_Service_Analytics_UnsampledReportCloudStorageDownloadDetails extends Deconf_Model
|
9204 |
{
|
9205 |
protected $internal_gapi_mappings = array(
|
9206 |
);
|
9226 |
}
|
9227 |
}
|
9228 |
|
9229 |
+
class Deconf_Service_Analytics_UnsampledReportDriveDownloadDetails extends Deconf_Model
|
9230 |
{
|
9231 |
protected $internal_gapi_mappings = array(
|
9232 |
);
|
9243 |
}
|
9244 |
}
|
9245 |
|
9246 |
+
class Deconf_Service_Analytics_UnsampledReports extends Deconf_Collection
|
9247 |
{
|
9248 |
protected $collection_key = 'items';
|
9249 |
protected $internal_gapi_mappings = array(
|
9250 |
);
|
9251 |
+
protected $itemsType = 'Deconf_Service_Analytics_UnsampledReport';
|
9252 |
protected $itemsDataType = 'array';
|
9253 |
public $itemsPerPage;
|
9254 |
public $kind;
|
9325 |
}
|
9326 |
}
|
9327 |
|
9328 |
+
class Deconf_Service_Analytics_Upload extends Deconf_Collection
|
9329 |
{
|
9330 |
protected $collection_key = 'errors';
|
9331 |
protected $internal_gapi_mappings = array(
|
9388 |
}
|
9389 |
}
|
9390 |
|
9391 |
+
class Deconf_Service_Analytics_Uploads extends Deconf_Collection
|
9392 |
{
|
9393 |
protected $collection_key = 'items';
|
9394 |
protected $internal_gapi_mappings = array(
|
9395 |
);
|
9396 |
+
protected $itemsType = 'Deconf_Service_Analytics_Upload';
|
9397 |
protected $itemsDataType = 'array';
|
9398 |
public $itemsPerPage;
|
9399 |
public $kind;
|
9461 |
}
|
9462 |
}
|
9463 |
|
9464 |
+
class Deconf_Service_Analytics_UserRef extends Deconf_Model
|
9465 |
{
|
9466 |
protected $internal_gapi_mappings = array(
|
9467 |
);
|
9496 |
}
|
9497 |
}
|
9498 |
|
9499 |
+
class Deconf_Service_Analytics_WebPropertyRef extends Deconf_Model
|
9500 |
{
|
9501 |
protected $internal_gapi_mappings = array(
|
9502 |
);
|
9558 |
}
|
9559 |
}
|
9560 |
|
9561 |
+
class Deconf_Service_Analytics_WebPropertySummary extends Deconf_Collection
|
9562 |
{
|
9563 |
protected $collection_key = 'profiles';
|
9564 |
protected $internal_gapi_mappings = array(
|
9568 |
public $kind;
|
9569 |
public $level;
|
9570 |
public $name;
|
9571 |
+
protected $profilesType = 'Deconf_Service_Analytics_ProfileSummary';
|
9572 |
protected $profilesDataType = 'array';
|
9573 |
public $websiteUrl;
|
9574 |
|
9631 |
}
|
9632 |
}
|
9633 |
|
9634 |
+
class Deconf_Service_Analytics_Webproperties extends Deconf_Collection
|
9635 |
{
|
9636 |
protected $collection_key = 'items';
|
9637 |
protected $internal_gapi_mappings = array(
|
9638 |
);
|
9639 |
+
protected $itemsType = 'Deconf_Service_Analytics_Webproperty';
|
9640 |
protected $itemsDataType = 'array';
|
9641 |
public $itemsPerPage;
|
9642 |
public $kind;
|
9713 |
}
|
9714 |
}
|
9715 |
|
9716 |
+
class Deconf_Service_Analytics_Webproperty extends Deconf_Model
|
9717 |
{
|
9718 |
protected $internal_gapi_mappings = array(
|
9719 |
);
|
9720 |
public $accountId;
|
9721 |
+
protected $childLinkType = 'Deconf_Service_Analytics_WebpropertyChildLink';
|
9722 |
protected $childLinkDataType = '';
|
9723 |
public $created;
|
9724 |
public $defaultProfileId;
|
9728 |
public $kind;
|
9729 |
public $level;
|
9730 |
public $name;
|
9731 |
+
protected $parentLinkType = 'Deconf_Service_Analytics_WebpropertyParentLink';
|
9732 |
protected $parentLinkDataType = '';
|
9733 |
+
protected $permissionsType = 'Deconf_Service_Analytics_WebpropertyPermissions';
|
9734 |
protected $permissionsDataType = '';
|
9735 |
public $profileCount;
|
9736 |
public $selfLink;
|
9746 |
{
|
9747 |
return $this->accountId;
|
9748 |
}
|
9749 |
+
public function setChildLink(Deconf_Service_Analytics_WebpropertyChildLink $childLink)
|
9750 |
{
|
9751 |
$this->childLink = $childLink;
|
9752 |
}
|
9818 |
{
|
9819 |
return $this->name;
|
9820 |
}
|
9821 |
+
public function setParentLink(Deconf_Service_Analytics_WebpropertyParentLink $parentLink)
|
9822 |
{
|
9823 |
$this->parentLink = $parentLink;
|
9824 |
}
|
9826 |
{
|
9827 |
return $this->parentLink;
|
9828 |
}
|
9829 |
+
public function setPermissions(Deconf_Service_Analytics_WebpropertyPermissions $permissions)
|
9830 |
{
|
9831 |
$this->permissions = $permissions;
|
9832 |
}
|
9868 |
}
|
9869 |
}
|
9870 |
|
9871 |
+
class Deconf_Service_Analytics_WebpropertyChildLink extends Deconf_Model
|
9872 |
{
|
9873 |
protected $internal_gapi_mappings = array(
|
9874 |
);
|
9894 |
}
|
9895 |
}
|
9896 |
|
9897 |
+
class Deconf_Service_Analytics_WebpropertyParentLink extends Deconf_Model
|
9898 |
{
|
9899 |
protected $internal_gapi_mappings = array(
|
9900 |
);
|
9920 |
}
|
9921 |
}
|
9922 |
|
9923 |
+
class Deconf_Service_Analytics_WebpropertyPermissions extends Deconf_Collection
|
9924 |
{
|
9925 |
protected $collection_key = 'effective';
|
9926 |
protected $internal_gapi_mappings = array(
|
tools/src/{Google → Deconf}/Service/Exception.php
RENAMED
@@ -15,11 +15,11 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
/**
|
25 |
* Optional list of errors returned in a JSON body of an HTTP error response.
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
+
class Deconf_Service_Exception extends Deconf_Exception implements Deconf_Task_Retryable
|
23 |
{
|
24 |
/**
|
25 |
* Optional list of errors returned in a JSON body of an HTTP error response.
|
tools/src/{Google → Deconf}/Service/Resource.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -25,7 +25,7 @@ if (!class_exists('Google_Client')) {
|
|
25 |
* is available in this service, and if so construct an apiHttpRequest representing it.
|
26 |
*
|
27 |
*/
|
28 |
-
class
|
29 |
{
|
30 |
// Valid query parameters that work, but don't appear in discovery.
|
31 |
private $stackParameters = array(
|
@@ -44,7 +44,7 @@ class Google_Service_Resource
|
|
44 |
/** @var string $rootUrl */
|
45 |
private $rootUrl;
|
46 |
|
47 |
-
/** @var
|
48 |
private $client;
|
49 |
|
50 |
/** @var string $serviceName */
|
@@ -76,8 +76,8 @@ class Google_Service_Resource
|
|
76 |
* @param $name
|
77 |
* @param $arguments
|
78 |
* @param $expected_class - optional, the expected class name
|
79 |
-
* @return
|
80 |
-
* @throws
|
81 |
*/
|
82 |
public function call($name, $arguments, $expected_class = null)
|
83 |
{
|
@@ -91,7 +91,7 @@ class Google_Service_Resource
|
|
91 |
)
|
92 |
);
|
93 |
|
94 |
-
throw new
|
95 |
"Unknown function: " .
|
96 |
"{$this->serviceName}->{$this->resourceName}->{$name}()"
|
97 |
);
|
@@ -103,7 +103,7 @@ class Google_Service_Resource
|
|
103 |
// document as parameter, but we abuse the param entry for storing it.
|
104 |
$postBody = null;
|
105 |
if (isset($parameters['postBody'])) {
|
106 |
-
if ($parameters['postBody'] instanceof
|
107 |
// In the cases the post body is an existing object, we want
|
108 |
// to use the smart method to create a simple object for
|
109 |
// for JSONification.
|
@@ -116,7 +116,7 @@ class Google_Service_Resource
|
|
116 |
}
|
117 |
$postBody = json_encode($parameters['postBody']);
|
118 |
if ($postBody === false && $parameters['postBody'] !== false) {
|
119 |
-
throw new
|
120 |
}
|
121 |
unset($parameters['postBody']);
|
122 |
}
|
@@ -148,7 +148,7 @@ class Google_Service_Resource
|
|
148 |
'parameter' => $key
|
149 |
)
|
150 |
);
|
151 |
-
throw new
|
152 |
}
|
153 |
}
|
154 |
|
@@ -166,7 +166,7 @@ class Google_Service_Resource
|
|
166 |
'parameter' => $paramName
|
167 |
)
|
168 |
);
|
169 |
-
throw new
|
170 |
}
|
171 |
if (isset($parameters[$paramName])) {
|
172 |
$value = $parameters[$paramName];
|
@@ -189,12 +189,12 @@ class Google_Service_Resource
|
|
189 |
)
|
190 |
);
|
191 |
|
192 |
-
$url =
|
193 |
$this->servicePath,
|
194 |
$method['path'],
|
195 |
$parameters
|
196 |
);
|
197 |
-
$httpRequest = new
|
198 |
$url,
|
199 |
$method['httpMethod'],
|
200 |
null,
|
@@ -220,7 +220,7 @@ class Google_Service_Resource
|
|
220 |
if (isset($parameters['data']) &&
|
221 |
($parameters['uploadType']['value'] == 'media' || $parameters['uploadType']['value'] == 'multipart')) {
|
222 |
// If we are doing a simple media upload, trigger that as a convenience.
|
223 |
-
$mfu = new
|
224 |
$this->client,
|
225 |
$httpRequest,
|
226 |
isset($parameters['mimeType']) ? $parameters['mimeType']['value'] : 'application/octet-stream',
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
25 |
* is available in this service, and if so construct an apiHttpRequest representing it.
|
26 |
*
|
27 |
*/
|
28 |
+
class Deconf_Service_Resource
|
29 |
{
|
30 |
// Valid query parameters that work, but don't appear in discovery.
|
31 |
private $stackParameters = array(
|
44 |
/** @var string $rootUrl */
|
45 |
private $rootUrl;
|
46 |
|
47 |
+
/** @var Deconf_Client $client */
|
48 |
private $client;
|
49 |
|
50 |
/** @var string $serviceName */
|
76 |
* @param $name
|
77 |
* @param $arguments
|
78 |
* @param $expected_class - optional, the expected class name
|
79 |
+
* @return Deconf_Http_Request|expected_class
|
80 |
+
* @throws Deconf_Exception
|
81 |
*/
|
82 |
public function call($name, $arguments, $expected_class = null)
|
83 |
{
|
91 |
)
|
92 |
);
|
93 |
|
94 |
+
throw new Deconf_Exception(
|
95 |
"Unknown function: " .
|
96 |
"{$this->serviceName}->{$this->resourceName}->{$name}()"
|
97 |
);
|
103 |
// document as parameter, but we abuse the param entry for storing it.
|
104 |
$postBody = null;
|
105 |
if (isset($parameters['postBody'])) {
|
106 |
+
if ($parameters['postBody'] instanceof Deconf_Model) {
|
107 |
// In the cases the post body is an existing object, we want
|
108 |
// to use the smart method to create a simple object for
|
109 |
// for JSONification.
|
116 |
}
|
117 |
$postBody = json_encode($parameters['postBody']);
|
118 |
if ($postBody === false && $parameters['postBody'] !== false) {
|
119 |
+
throw new Deconf_Exception("JSON encoding failed. Ensure all strings in the request are UTF-8 encoded.");
|
120 |
}
|
121 |
unset($parameters['postBody']);
|
122 |
}
|
148 |
'parameter' => $key
|
149 |
)
|
150 |
);
|
151 |
+
throw new Deconf_Exception("($name) unknown parameter: '$key'");
|
152 |
}
|
153 |
}
|
154 |
|
166 |
'parameter' => $paramName
|
167 |
)
|
168 |
);
|
169 |
+
throw new Deconf_Exception("($name) missing required param: '$paramName'");
|
170 |
}
|
171 |
if (isset($parameters[$paramName])) {
|
172 |
$value = $parameters[$paramName];
|
189 |
)
|
190 |
);
|
191 |
|
192 |
+
$url = Deconf_Http_REST::createRequestUri(
|
193 |
$this->servicePath,
|
194 |
$method['path'],
|
195 |
$parameters
|
196 |
);
|
197 |
+
$httpRequest = new Deconf_Http_Request(
|
198 |
$url,
|
199 |
$method['httpMethod'],
|
200 |
null,
|
220 |
if (isset($parameters['data']) &&
|
221 |
($parameters['uploadType']['value'] == 'media' || $parameters['uploadType']['value'] == 'multipart')) {
|
222 |
// If we are doing a simple media upload, trigger that as a convenience.
|
223 |
+
$mfu = new Deconf_Http_MediaFileUpload(
|
224 |
$this->client,
|
225 |
$httpRequest,
|
226 |
isset($parameters['mimeType']) ? $parameters['mimeType']['value'] : 'application/octet-stream',
|
tools/src/{Google → Deconf}/Signer/Abstract.php
RENAMED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @author Brian Eaton <beaton@google.com>
|
22 |
*/
|
23 |
-
abstract class
|
24 |
{
|
25 |
/**
|
26 |
* Signs data, returns the signature as binary data.
|
20 |
*
|
21 |
* @author Brian Eaton <beaton@google.com>
|
22 |
*/
|
23 |
+
abstract class Deconf_Signer_Abstract
|
24 |
{
|
25 |
/**
|
26 |
* Signs data, returns the signature as binary data.
|
tools/src/{Google → Deconf}/Signer/P12.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -26,7 +26,7 @@ if (!class_exists('Google_Client')) {
|
|
26 |
*
|
27 |
* @author Brian Eaton <beaton@google.com>
|
28 |
*/
|
29 |
-
class
|
30 |
{
|
31 |
// OpenSSL private key resource
|
32 |
private $privateKey;
|
@@ -35,7 +35,7 @@ class Google_Signer_P12 extends Google_Signer_Abstract
|
|
35 |
public function __construct($p12, $password)
|
36 |
{
|
37 |
if (!function_exists('openssl_x509_read')) {
|
38 |
-
throw new
|
39 |
'The Google PHP API library needs the openssl PHP extension'
|
40 |
);
|
41 |
}
|
@@ -52,7 +52,7 @@ class Google_Signer_P12 extends Google_Signer_Abstract
|
|
52 |
// This throws on error
|
53 |
$certs = array();
|
54 |
if (!openssl_pkcs12_read($p12, $certs, $password)) {
|
55 |
-
throw new
|
56 |
"Unable to parse the p12 file. " .
|
57 |
"Is this a .p12 file? Is the password correct? OpenSSL error: " .
|
58 |
openssl_error_string()
|
@@ -61,13 +61,13 @@ class Google_Signer_P12 extends Google_Signer_Abstract
|
|
61 |
// TODO(beaton): is this part of the contract for the openssl_pkcs12_read
|
62 |
// method? What happens if there are multiple private keys? Do we care?
|
63 |
if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) {
|
64 |
-
throw new
|
65 |
}
|
66 |
$this->privateKey = openssl_pkey_get_private($certs['pkey']);
|
67 |
}
|
68 |
|
69 |
if (!$this->privateKey) {
|
70 |
-
throw new
|
71 |
}
|
72 |
}
|
73 |
|
@@ -81,13 +81,13 @@ class Google_Signer_P12 extends Google_Signer_Abstract
|
|
81 |
public function sign($data)
|
82 |
{
|
83 |
if (version_compare(PHP_VERSION, '5.3.0') < 0) {
|
84 |
-
throw new
|
85 |
"PHP 5.3.0 or higher is required to use service accounts."
|
86 |
);
|
87 |
}
|
88 |
$hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256";
|
89 |
if (!openssl_sign($data, $signature, $this->privateKey, $hash)) {
|
90 |
-
throw new
|
91 |
}
|
92 |
return $signature;
|
93 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
26 |
*
|
27 |
* @author Brian Eaton <beaton@google.com>
|
28 |
*/
|
29 |
+
class Deconf_Signer_P12 extends Deconf_Signer_Abstract
|
30 |
{
|
31 |
// OpenSSL private key resource
|
32 |
private $privateKey;
|
35 |
public function __construct($p12, $password)
|
36 |
{
|
37 |
if (!function_exists('openssl_x509_read')) {
|
38 |
+
throw new Deconf_Exception(
|
39 |
'The Google PHP API library needs the openssl PHP extension'
|
40 |
);
|
41 |
}
|
52 |
// This throws on error
|
53 |
$certs = array();
|
54 |
if (!openssl_pkcs12_read($p12, $certs, $password)) {
|
55 |
+
throw new Deconf_Auth_Exception(
|
56 |
"Unable to parse the p12 file. " .
|
57 |
"Is this a .p12 file? Is the password correct? OpenSSL error: " .
|
58 |
openssl_error_string()
|
61 |
// TODO(beaton): is this part of the contract for the openssl_pkcs12_read
|
62 |
// method? What happens if there are multiple private keys? Do we care?
|
63 |
if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) {
|
64 |
+
throw new Deconf_Auth_Exception("No private key found in p12 file.");
|
65 |
}
|
66 |
$this->privateKey = openssl_pkey_get_private($certs['pkey']);
|
67 |
}
|
68 |
|
69 |
if (!$this->privateKey) {
|
70 |
+
throw new Deconf_Auth_Exception("Unable to load private key");
|
71 |
}
|
72 |
}
|
73 |
|
81 |
public function sign($data)
|
82 |
{
|
83 |
if (version_compare(PHP_VERSION, '5.3.0') < 0) {
|
84 |
+
throw new Deconf_Auth_Exception(
|
85 |
"PHP 5.3.0 or higher is required to use service accounts."
|
86 |
);
|
87 |
}
|
88 |
$hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256";
|
89 |
if (!openssl_sign($data, $signature, $this->privateKey, $hash)) {
|
90 |
+
throw new Deconf_Auth_Exception("Unable to sign data");
|
91 |
}
|
92 |
return $signature;
|
93 |
}
|
tools/src/{Google → Deconf}/Task/Exception.php
RENAMED
@@ -15,10 +15,10 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
22 |
+
class Deconf_Task_Exception extends Deconf_Exception
|
23 |
{
|
24 |
}
|
tools/src/{Google → Deconf}/Task/Retryable.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -23,7 +23,7 @@ if (!class_exists('Google_Client')) {
|
|
23 |
* Interface for checking how many times a given task can be retried following
|
24 |
* a failure.
|
25 |
*/
|
26 |
-
interface
|
27 |
{
|
28 |
/**
|
29 |
* Gets the number of times the associated task can be retried.
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
23 |
* Interface for checking how many times a given task can be retried following
|
24 |
* a failure.
|
25 |
*/
|
26 |
+
interface Deconf_Task_Retryable
|
27 |
{
|
28 |
/**
|
29 |
* Gets the number of times the associated task can be retried.
|
tools/src/{Google → Deconf}/Task/Runner.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,7 +24,7 @@ if (!class_exists('Google_Client')) {
|
|
24 |
*
|
25 |
* @see https://developers.google.com/drive/web/handle-errors#implementing_exponential_backoff
|
26 |
*/
|
27 |
-
class
|
28 |
{
|
29 |
/**
|
30 |
* @var integer $maxDelay The max time (in seconds) to wait before a retry.
|
@@ -56,7 +56,7 @@ class Google_Task_Runner
|
|
56 |
private $maxAttempts = 1;
|
57 |
|
58 |
/**
|
59 |
-
* @var
|
60 |
*/
|
61 |
private $client;
|
62 |
|
@@ -76,23 +76,23 @@ class Google_Task_Runner
|
|
76 |
/**
|
77 |
* Creates a new task runner with exponential backoff support.
|
78 |
*
|
79 |
-
* @param
|
80 |
* @param string $name The name of the current task (used for logging)
|
81 |
* @param callable $action The task to run and possibly retry
|
82 |
* @param array $arguments The task arguments
|
83 |
-
* @throws
|
84 |
*/
|
85 |
public function __construct(
|
86 |
-
|
87 |
$name,
|
88 |
$action,
|
89 |
array $arguments = array()
|
90 |
) {
|
91 |
-
$config = (array) $client->getClassConfig('
|
92 |
|
93 |
if (isset($config['initial_delay'])) {
|
94 |
if ($config['initial_delay'] < 0) {
|
95 |
-
throw new
|
96 |
'Task configuration `initial_delay` must not be negative.'
|
97 |
);
|
98 |
}
|
@@ -102,7 +102,7 @@ class Google_Task_Runner
|
|
102 |
|
103 |
if (isset($config['max_delay'])) {
|
104 |
if ($config['max_delay'] <= 0) {
|
105 |
-
throw new
|
106 |
'Task configuration `max_delay` must be greater than 0.'
|
107 |
);
|
108 |
}
|
@@ -112,7 +112,7 @@ class Google_Task_Runner
|
|
112 |
|
113 |
if (isset($config['factor'])) {
|
114 |
if ($config['factor'] <= 0) {
|
115 |
-
throw new
|
116 |
'Task configuration `factor` must be greater than 0.'
|
117 |
);
|
118 |
}
|
@@ -122,7 +122,7 @@ class Google_Task_Runner
|
|
122 |
|
123 |
if (isset($config['jitter'])) {
|
124 |
if ($config['jitter'] <= 0) {
|
125 |
-
throw new
|
126 |
'Task configuration `jitter` must be greater than 0.'
|
127 |
);
|
128 |
}
|
@@ -132,7 +132,7 @@ class Google_Task_Runner
|
|
132 |
|
133 |
if (isset($config['retries'])) {
|
134 |
if ($config['retries'] < 0) {
|
135 |
-
throw new
|
136 |
'Task configuration `retries` must not be negative.'
|
137 |
);
|
138 |
}
|
@@ -140,7 +140,7 @@ class Google_Task_Runner
|
|
140 |
}
|
141 |
|
142 |
if (!is_callable($action)) {
|
143 |
-
throw new
|
144 |
'Task argument `$action` must be a valid callable.'
|
145 |
);
|
146 |
}
|
@@ -165,14 +165,14 @@ class Google_Task_Runner
|
|
165 |
* Runs the task and (if applicable) automatically retries when errors occur.
|
166 |
*
|
167 |
* @return mixed
|
168 |
-
* @throws
|
169 |
*/
|
170 |
public function run()
|
171 |
{
|
172 |
while ($this->attempt()) {
|
173 |
try {
|
174 |
return call_user_func_array($this->action, $this->arguments);
|
175 |
-
} catch (
|
176 |
$allowedRetries = $exception->allowedRetries();
|
177 |
|
178 |
if (!$this->canAttmpt() || !$allowedRetries) {
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
*
|
25 |
* @see https://developers.google.com/drive/web/handle-errors#implementing_exponential_backoff
|
26 |
*/
|
27 |
+
class Deconf_Task_Runner
|
28 |
{
|
29 |
/**
|
30 |
* @var integer $maxDelay The max time (in seconds) to wait before a retry.
|
56 |
private $maxAttempts = 1;
|
57 |
|
58 |
/**
|
59 |
+
* @var Deconf_Client $client The current API client.
|
60 |
*/
|
61 |
private $client;
|
62 |
|
76 |
/**
|
77 |
* Creates a new task runner with exponential backoff support.
|
78 |
*
|
79 |
+
* @param Deconf_Client $client The current API client
|
80 |
* @param string $name The name of the current task (used for logging)
|
81 |
* @param callable $action The task to run and possibly retry
|
82 |
* @param array $arguments The task arguments
|
83 |
+
* @throws Deconf_Task_Exception when misconfigured
|
84 |
*/
|
85 |
public function __construct(
|
86 |
+
Deconf_Client $client,
|
87 |
$name,
|
88 |
$action,
|
89 |
array $arguments = array()
|
90 |
) {
|
91 |
+
$config = (array) $client->getClassConfig('Deconf_Task_Runner');
|
92 |
|
93 |
if (isset($config['initial_delay'])) {
|
94 |
if ($config['initial_delay'] < 0) {
|
95 |
+
throw new Deconf_Task_Exception(
|
96 |
'Task configuration `initial_delay` must not be negative.'
|
97 |
);
|
98 |
}
|
102 |
|
103 |
if (isset($config['max_delay'])) {
|
104 |
if ($config['max_delay'] <= 0) {
|
105 |
+
throw new Deconf_Task_Exception(
|
106 |
'Task configuration `max_delay` must be greater than 0.'
|
107 |
);
|
108 |
}
|
112 |
|
113 |
if (isset($config['factor'])) {
|
114 |
if ($config['factor'] <= 0) {
|
115 |
+
throw new Deconf_Task_Exception(
|
116 |
'Task configuration `factor` must be greater than 0.'
|
117 |
);
|
118 |
}
|
122 |
|
123 |
if (isset($config['jitter'])) {
|
124 |
if ($config['jitter'] <= 0) {
|
125 |
+
throw new Deconf_Task_Exception(
|
126 |
'Task configuration `jitter` must be greater than 0.'
|
127 |
);
|
128 |
}
|
132 |
|
133 |
if (isset($config['retries'])) {
|
134 |
if ($config['retries'] < 0) {
|
135 |
+
throw new Deconf_Task_Exception(
|
136 |
'Task configuration `retries` must not be negative.'
|
137 |
);
|
138 |
}
|
140 |
}
|
141 |
|
142 |
if (!is_callable($action)) {
|
143 |
+
throw new Deconf_Task_Exception(
|
144 |
'Task argument `$action` must be a valid callable.'
|
145 |
);
|
146 |
}
|
165 |
* Runs the task and (if applicable) automatically retries when errors occur.
|
166 |
*
|
167 |
* @return mixed
|
168 |
+
* @throws Deconf_Task_Retryable on failure when no retries are available.
|
169 |
*/
|
170 |
public function run()
|
171 |
{
|
172 |
while ($this->attempt()) {
|
173 |
try {
|
174 |
return call_user_func_array($this->action, $this->arguments);
|
175 |
+
} catch (Deconf_Task_Retryable $exception) {
|
176 |
$allowedRetries = $exception->allowedRetries();
|
177 |
|
178 |
if (!$this->canAttmpt() || !$allowedRetries) {
|
tools/src/{Google → Deconf}/Utils.php
RENAMED
@@ -19,7 +19,7 @@
|
|
19 |
* Collection of static utility methods used for convenience across
|
20 |
* the client library.
|
21 |
*/
|
22 |
-
class
|
23 |
{
|
24 |
public static function urlSafeB64Encode($data)
|
25 |
{
|
19 |
* Collection of static utility methods used for convenience across
|
20 |
* the client library.
|
21 |
*/
|
22 |
+
class Deconf_Utils
|
23 |
{
|
24 |
public static function urlSafeB64Encode($data)
|
25 |
{
|
tools/src/{Google → Deconf}/Utils/URITemplate.php
RENAMED
@@ -19,7 +19,7 @@
|
|
19 |
* Implementation of levels 1-3 of the URI Template spec.
|
20 |
* @see http://tools.ietf.org/html/rfc6570
|
21 |
*/
|
22 |
-
class
|
23 |
{
|
24 |
const TYPE_MAP = "1";
|
25 |
const TYPE_LIST = "2";
|
19 |
* Implementation of levels 1-3 of the URI Template spec.
|
20 |
* @see http://tools.ietf.org/html/rfc6570
|
21 |
*/
|
22 |
+
class Deconf_Utils_URITemplate
|
23 |
{
|
24 |
const TYPE_MAP = "1";
|
25 |
const TYPE_LIST = "2";
|
tools/src/{Google → Deconf}/Verifier/Abstract.php
RENAMED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @author Brian Eaton <beaton@google.com>
|
22 |
*/
|
23 |
-
abstract class
|
24 |
{
|
25 |
/**
|
26 |
* Checks a signature, returns true if the signature is correct,
|
20 |
*
|
21 |
* @author Brian Eaton <beaton@google.com>
|
22 |
*/
|
23 |
+
abstract class Deconf_Verifier_Abstract
|
24 |
{
|
25 |
/**
|
26 |
* Checks a signature, returns true if the signature is correct,
|
tools/src/{Google → Deconf}/Verifier/Pem.php
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
-
if (!class_exists('
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
@@ -24,7 +24,7 @@ if (!class_exists('Google_Client')) {
|
|
24 |
*
|
25 |
* @author Brian Eaton <beaton@google.com>
|
26 |
*/
|
27 |
-
class
|
28 |
{
|
29 |
private $publicKey;
|
30 |
|
@@ -33,17 +33,17 @@ class Google_Verifier_Pem extends Google_Verifier_Abstract
|
|
33 |
*
|
34 |
* $pem: a PEM encoded certificate (not a file).
|
35 |
* @param $pem
|
36 |
-
* @throws
|
37 |
-
* @throws
|
38 |
*/
|
39 |
public function __construct($pem)
|
40 |
{
|
41 |
if (!function_exists('openssl_x509_read')) {
|
42 |
-
throw new
|
43 |
}
|
44 |
$this->publicKey = openssl_x509_read($pem);
|
45 |
if (!$this->publicKey) {
|
46 |
-
throw new
|
47 |
}
|
48 |
}
|
49 |
|
@@ -60,7 +60,7 @@ class Google_Verifier_Pem extends Google_Verifier_Abstract
|
|
60 |
* Returns true if the signature is valid, false otherwise.
|
61 |
* @param $data
|
62 |
* @param $signature
|
63 |
-
* @throws
|
64 |
* @return bool
|
65 |
*/
|
66 |
public function verify($data, $signature)
|
@@ -68,7 +68,7 @@ class Google_Verifier_Pem extends Google_Verifier_Abstract
|
|
68 |
$hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256";
|
69 |
$status = openssl_verify($data, $signature, $this->publicKey, $hash);
|
70 |
if ($status === -1) {
|
71 |
-
throw new
|
72 |
}
|
73 |
return $status === 1;
|
74 |
}
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
|
18 |
+
if (!class_exists('Deconf_Client')) {
|
19 |
require_once dirname(__FILE__) . '/../autoload.php';
|
20 |
}
|
21 |
|
24 |
*
|
25 |
* @author Brian Eaton <beaton@google.com>
|
26 |
*/
|
27 |
+
class Deconf_Verifier_Pem extends Deconf_Verifier_Abstract
|
28 |
{
|
29 |
private $publicKey;
|
30 |
|
33 |
*
|
34 |
* $pem: a PEM encoded certificate (not a file).
|
35 |
* @param $pem
|
36 |
+
* @throws Deconf_Auth_Exception
|
37 |
+
* @throws Deconf_Exception
|
38 |
*/
|
39 |
public function __construct($pem)
|
40 |
{
|
41 |
if (!function_exists('openssl_x509_read')) {
|
42 |
+
throw new Deconf_Exception('Google API PHP client needs the openssl PHP extension');
|
43 |
}
|
44 |
$this->publicKey = openssl_x509_read($pem);
|
45 |
if (!$this->publicKey) {
|
46 |
+
throw new Deconf_Auth_Exception("Unable to parse PEM: $pem");
|
47 |
}
|
48 |
}
|
49 |
|
60 |
* Returns true if the signature is valid, false otherwise.
|
61 |
* @param $data
|
62 |
* @param $signature
|
63 |
+
* @throws Deconf_Auth_Exception
|
64 |
* @return bool
|
65 |
*/
|
66 |
public function verify($data, $signature)
|
68 |
$hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256";
|
69 |
$status = openssl_verify($data, $signature, $this->publicKey, $hash);
|
70 |
if ($status === -1) {
|
71 |
+
throw new Deconf_Auth_Exception('Signature verification error: ' . openssl_error_string());
|
72 |
}
|
73 |
return $status === 1;
|
74 |
}
|
tools/src/{Google → Deconf}/autoload.php
RENAMED
@@ -18,7 +18,7 @@
|
|
18 |
function google_api_php_client_autoload_gadwp($className)
|
19 |
{
|
20 |
$classPath = explode('_', $className);
|
21 |
-
if ($classPath[0] != '
|
22 |
return;
|
23 |
}
|
24 |
// Drop 'Google', and maximum class file path depth in this project is 3.
|
18 |
function google_api_php_client_autoload_gadwp($className)
|
19 |
{
|
20 |
$classPath = explode('_', $className);
|
21 |
+
if ($classPath[0] != 'Deconf') {
|
22 |
return;
|
23 |
}
|
24 |
// Drop 'Google', and maximum class file path depth in this project is 3.
|
tools/tools.php
CHANGED
@@ -199,11 +199,25 @@ if ( ! class_exists( 'GADWP_Tools' ) ) {
|
|
199 |
* @return boolean - If template file was found
|
200 |
**/
|
201 |
public static function load_view( $path, $data = array() ) {
|
202 |
-
if( file_exists( GADWP_DIR . $path ) ) {
|
203 |
-
require_once( GADWP_DIR . $path );
|
204 |
return true;
|
205 |
}
|
206 |
return false;
|
207 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
}
|
209 |
}
|
199 |
* @return boolean - If template file was found
|
200 |
**/
|
201 |
public static function load_view( $path, $data = array() ) {
|
202 |
+
if ( file_exists( GADWP_DIR . $path ) ) {
|
203 |
+
require_once ( GADWP_DIR . $path );
|
204 |
return true;
|
205 |
}
|
206 |
return false;
|
207 |
}
|
208 |
+
|
209 |
+
public static function doing_it_wrong( $function, $message, $version ) {
|
210 |
+
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
|
211 |
+
if ( is_null( $version ) ) {
|
212 |
+
$version = '';
|
213 |
+
} else {
|
214 |
+
/* translators: %s: version number */
|
215 |
+
$version = sprintf( __( 'This message was added in version %s.', 'google-analytics-dashboard-for-wp' ), $version );
|
216 |
+
}
|
217 |
+
|
218 |
+
/* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message */
|
219 |
+
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', 'google-analytics-dashboard-for-wp' ), $function, $message, $version ) );
|
220 |
+
}
|
221 |
+
}
|
222 |
}
|
223 |
}
|