delete(accountId, webPropertyId, profileId, experimentId)
Delete an experiment.
get(accountId, webPropertyId, profileId, experimentId)
Returns an experiment to which the user has access.
insert(accountId, webPropertyId, profileId, body)
Create a new experiment.
list(accountId, webPropertyId, profileId, max_results=None, start_index=None)
Lists experiments to which the user has access.
patch(accountId, webPropertyId, profileId, experimentId, body)
Update an existing experiment. This method supports patch semantics.
update(accountId, webPropertyId, profileId, experimentId, body)
Update an existing experiment.
delete(accountId, webPropertyId, profileId, experimentId)
Delete an experiment. Args: accountId: string, Account ID to which the experiment belongs (required) webPropertyId: string, Web property ID to which the experiment belongs (required) profileId: string, View (Profile) ID to which the experiment belongs (required) experimentId: string, ID of the experiment to delete (required)
get(accountId, webPropertyId, profileId, experimentId)
Returns an experiment to which the user has access. Args: accountId: string, Account ID to retrieve the experiment for. (required) webPropertyId: string, Web property ID to retrieve the experiment for. (required) profileId: string, View (Profile) ID to retrieve the experiment for. (required) experimentId: string, Experiment ID to retrieve the experiment for. (required) Returns: An object of the form: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. }
insert(accountId, webPropertyId, profileId, body)
Create a new experiment. Args: accountId: string, Account ID to create the experiment for. (required) webPropertyId: string, Web property ID to create the experiment for. (required) profileId: string, View (Profile) ID to create the experiment for. (required) body: object, The request body. (required) The object takes the form of: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. } Returns: An object of the form: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. }
list(accountId, webPropertyId, profileId, max_results=None, start_index=None)
Lists experiments to which the user has access. Args: accountId: string, Account ID to retrieve experiments for. (required) webPropertyId: string, Web property ID to retrieve experiments for. (required) profileId: string, View (Profile) ID to retrieve experiments for. (required) max_results: integer, The maximum number of experiments to include in this response. start_index: integer, An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. Returns: An object of the form: { # An experiment collection lists Analytics experiments to which the user has access. Each view (profile) can have a set of experiments. Each resource in the Experiment collection corresponds to a single Analytics experiment. "username": "A String", # Email ID of the authenticated user "kind": "analytics#experiments", # Collection type. "items": [ # A list of experiments. { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. }, ], "itemsPerPage": 42, # The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter. "previousLink": "A String", # Link to previous page for this experiment collection. "startIndex": 42, # The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. "nextLink": "A String", # Link to next page for this experiment collection. "totalResults": 42, # The total number of results for the query, regardless of the number of resources in the result. }
patch(accountId, webPropertyId, profileId, experimentId, body)
Update an existing experiment. This method supports patch semantics. Args: accountId: string, Account ID of the experiment to update. (required) webPropertyId: string, Web property ID of the experiment to update. (required) profileId: string, View (Profile) ID of the experiment to update. (required) experimentId: string, Experiment ID of the experiment to update. (required) body: object, The request body. (required) The object takes the form of: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. } Returns: An object of the form: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. }
update(accountId, webPropertyId, profileId, experimentId, body)
Update an existing experiment. Args: accountId: string, Account ID of the experiment to update. (required) webPropertyId: string, Web property ID of the experiment to update. (required) profileId: string, View (Profile) ID of the experiment to update. (required) experimentId: string, Experiment ID of the experiment to update. (required) body: object, The request body. (required) The object takes the form of: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. } Returns: An object of the form: { # JSON template for Analytics experiment resource. "trafficCoverage": 3.14, # A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. "optimizationType": "A String", # Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API". "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create. "equalWeighting": True or False, # Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED. "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only. "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only. "editableInGaUi": True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface. "rewriteVariationUrlsAsOriginal": True or False, # Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED. "servingFramework": "A String", # The framework used to serve the experiment variations and evaluate the results. One of: # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation. # - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results. "status": "A String", # Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment. "updated": "A String", # Time the experiment was last modified. This field is read-only. "description": "A String", # Notes about this experiment. "reasonExperimentEnded": "A String", # Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only. "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only. "winnerConfidenceLevel": 3.14, # A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED. "startTime": "A String", # The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only. "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only. "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only. "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. "created": "A String", # Time the experiment was created. This field is read-only. "variations": [ # Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING. { "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. "name": "A String", # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only. }, ], "minimumExperimentLengthInDays": 42, # An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED. "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only. "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs. "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only. "type": "analytics#profile", # Value is "analytics#profile". This field is read-only. }, "endTime": "A String", # The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only. "selfLink": "A String", # Link for this experiment. This field is read-only. }