Class: Google::Apis::AnalyticsV3::Experiment
- Inherits:
-
Object
- Object
- Google::Apis::AnalyticsV3::Experiment
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/analytics_v3/classes.rb,
generated/google/apis/analytics_v3/representations.rb,
generated/google/apis/analytics_v3/representations.rb
Overview
JSON template for Analytics experiment resource.
Defined Under Namespace
Classes: ParentLink, Variation
Instance Attribute Summary collapse
-
#account_id ⇒ String
Account ID to which this experiment belongs.
-
#created ⇒ DateTime
Time the experiment was created.
-
#description ⇒ String
Notes about this experiment.
-
#editable_in_ga_ui ⇒ Boolean
(also: #editable_in_ga_ui?)
If true, the end user will be able to edit the experiment via the Google Analytics user interface.
-
#end_time ⇒ DateTime
The ending time of the experiment (the time the status changed from RUNNING to ENDED).
-
#equal_weighting ⇒ Boolean
(also: #equal_weighting?)
Boolean specifying whether to distribute traffic evenly across all variations.
-
#id ⇒ String
Experiment ID.
-
#internal_web_property_id ⇒ String
Internal ID for the web property to which this experiment belongs.
-
#kind ⇒ String
Resource type for an Analytics experiment.
-
#minimum_experiment_length_in_days ⇒ Fixnum
An integer number in [3, 90].
-
#name ⇒ String
Experiment name.
-
#objective_metric ⇒ String
The metric that the experiment is optimizing.
-
#optimization_type ⇒ String
Whether the objectiveMetric should be minimized or maximized.
-
#parent_link ⇒ Google::Apis::AnalyticsV3::Experiment::ParentLink
Parent link for an experiment.
-
#profile_id ⇒ String
View (Profile) ID to which this experiment belongs.
-
#reason_experiment_ended ⇒ String
Why the experiment ended.
-
#rewrite_variation_urls_as_original ⇒ Boolean
(also: #rewrite_variation_urls_as_original?)
Boolean specifying whether variations URLS are rewritten to match those of the original.
-
#self_link ⇒ String
Link for this experiment.
-
#serving_framework ⇒ String
The framework used to serve the experiment variations and evaluate the results.
-
#snippet ⇒ String
The snippet of code to include on the control page(s).
-
#start_time ⇒ DateTime
The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING).
-
#status ⇒ String
Experiment status.
-
#traffic_coverage ⇒ Float
A floating-point number in (0, 1].
-
#updated ⇒ DateTime
Time the experiment was last modified.
-
#variations ⇒ Array<Google::Apis::AnalyticsV3::Experiment::Variation>
Array of variations.
-
#web_property_id ⇒ String
Web property ID to which this experiment belongs.
-
#winner_confidence_level ⇒ Float
A floating-point number in (0, 1).
-
#winner_found ⇒ Boolean
(also: #winner_found?)
Boolean specifying whether a winner has been found for this experiment.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Experiment
constructor
A new instance of Experiment.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Experiment
Returns a new instance of Experiment
1865 1866 1867 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1865 def initialize(**args) update!(**args) end |
Instance Attribute Details
#account_id ⇒ String
Account ID to which this experiment belongs. This field is read-only.
Corresponds to the JSON property accountId
1678 1679 1680 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1678 def account_id @account_id end |
#created ⇒ DateTime
Time the experiment was created. This field is read-only.
Corresponds to the JSON property created
1683 1684 1685 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1683 def created @created end |
#description ⇒ String
Notes about this experiment.
Corresponds to the JSON property description
1688 1689 1690 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1688 def description @description end |
#editable_in_ga_ui ⇒ Boolean Also known as: editable_in_ga_ui?
If true, the end user will be able to edit the experiment via the Google
Analytics user interface.
Corresponds to the JSON property editableInGaUi
1694 1695 1696 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1694 def editable_in_ga_ui @editable_in_ga_ui end |
#end_time ⇒ DateTime
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.
Corresponds to the JSON property endTime
1702 1703 1704 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1702 def end_time @end_time end |
#equal_weighting ⇒ Boolean Also known as: equal_weighting?
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.
Corresponds to the JSON property equalWeighting
1711 1712 1713 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1711 def equal_weighting @equal_weighting end |
#id ⇒ String
Experiment ID. Required for patch and update. Disallowed for create.
Corresponds to the JSON property id
1717 1718 1719 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1717 def id @id end |
#internal_web_property_id ⇒ String
Internal ID for the web property to which this experiment belongs. This field
is read-only.
Corresponds to the JSON property internalWebPropertyId
1723 1724 1725 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1723 def internal_web_property_id @internal_web_property_id end |
#kind ⇒ String
Resource type for an Analytics experiment. This field is read-only.
Corresponds to the JSON property kind
1728 1729 1730 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1728 def kind @kind end |
#minimum_experiment_length_in_days ⇒ Fixnum
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.
Corresponds to the JSON property minimumExperimentLengthInDays
1735 1736 1737 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1735 def minimum_experiment_length_in_days @minimum_experiment_length_in_days end |
#name ⇒ String
Experiment name. This field may not be changed for an experiment whose status
is ENDED. This field is required when creating an experiment.
Corresponds to the JSON property name
1741 1742 1743 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1741 def name @name end |
#objective_metric ⇒ 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".
Corresponds to the JSON property objectiveMetric
1750 1751 1752 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1750 def objective_metric @objective_metric end |
#optimization_type ⇒ 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"
.
Corresponds to the JSON property optimizationType
1758 1759 1760 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1758 def optimization_type @optimization_type end |
#parent_link ⇒ Google::Apis::AnalyticsV3::Experiment::ParentLink
Parent link for an experiment. Points to the view (profile) to which this
experiment belongs.
Corresponds to the JSON property parentLink
1764 1765 1766 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1764 def parent_link @parent_link end |
#profile_id ⇒ String
View (Profile) ID to which this experiment belongs. This field is read-only.
Corresponds to the JSON property profileId
1769 1770 1771 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1769 def profile_id @profile_id end |
#reason_experiment_ended ⇒ 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.
Corresponds to the JSON property reasonExperimentEnded
1778 1779 1780 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1778 def reason_experiment_ended @reason_experiment_ended end |
#rewrite_variation_urls_as_original ⇒ Boolean Also known as: rewrite_variation_urls_as_original?
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.
Corresponds to the JSON property rewriteVariationUrlsAsOriginal
1785 1786 1787 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1785 def rewrite_variation_urls_as_original @rewrite_variation_urls_as_original end |
#self_link ⇒ String
Link for this experiment. This field is read-only.
Corresponds to the JSON property selfLink
1791 1792 1793 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1791 def self_link @self_link end |
#serving_framework ⇒ 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.
Corresponds to the JSON property
servingFramework
1805 1806 1807 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1805 def serving_framework @serving_framework end |
#snippet ⇒ String
The snippet of code to include on the control page(s). This field is read-only.
Corresponds to the JSON property snippet
1810 1811 1812 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1810 def snippet @snippet end |
#start_time ⇒ DateTime
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.
Corresponds to the JSON property startTime
1817 1818 1819 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1817 def start_time @start_time end |
#status ⇒ 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.
Corresponds to the JSON property status
1824 1825 1826 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1824 def status @status end |
#traffic_coverage ⇒ Float
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.
Corresponds to the JSON property trafficCoverage
1831 1832 1833 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1831 def traffic_coverage @traffic_coverage end |
#updated ⇒ DateTime
Time the experiment was last modified. This field is read-only.
Corresponds to the JSON property updated
1836 1837 1838 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1836 def updated @updated end |
#variations ⇒ Array<Google::Apis::AnalyticsV3::Experiment::Variation>
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.
Corresponds to the JSON property variations
1843 1844 1845 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1843 def variations @variations end |
#web_property_id ⇒ 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.
Corresponds to the JSON property webPropertyId
1849 1850 1851 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1849 def web_property_id @web_property_id end |
#winner_confidence_level ⇒ Float
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.
Corresponds to the JSON property winnerConfidenceLevel
1856 1857 1858 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1856 def winner_confidence_level @winner_confidence_level end |
#winner_found ⇒ Boolean Also known as: winner_found?
Boolean specifying whether a winner has been found for this experiment. This
field is read-only.
Corresponds to the JSON property winnerFound
1862 1863 1864 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1862 def winner_found @winner_found end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 |
# File 'generated/google/apis/analytics_v3/classes.rb', line 1870 def update!(**args) @account_id = args[:account_id] if args.key?(:account_id) @created = args[:created] if args.key?(:created) @description = args[:description] if args.key?(:description) @editable_in_ga_ui = args[:editable_in_ga_ui] if args.key?(:editable_in_ga_ui) @end_time = args[:end_time] if args.key?(:end_time) @equal_weighting = args[:equal_weighting] if args.key?(:equal_weighting) @id = args[:id] if args.key?(:id) @internal_web_property_id = args[:internal_web_property_id] if args.key?(:internal_web_property_id) @kind = args[:kind] if args.key?(:kind) @minimum_experiment_length_in_days = args[:minimum_experiment_length_in_days] if args.key?(:minimum_experiment_length_in_days) @name = args[:name] if args.key?(:name) @objective_metric = args[:objective_metric] if args.key?(:objective_metric) @optimization_type = args[:optimization_type] if args.key?(:optimization_type) @parent_link = args[:parent_link] if args.key?(:parent_link) @profile_id = args[:profile_id] if args.key?(:profile_id) @reason_experiment_ended = args[:reason_experiment_ended] if args.key?(:reason_experiment_ended) @rewrite_variation_urls_as_original = args[:rewrite_variation_urls_as_original] if args.key?(:rewrite_variation_urls_as_original) @self_link = args[:self_link] if args.key?(:self_link) @serving_framework = args[:serving_framework] if args.key?(:serving_framework) @snippet = args[:snippet] if args.key?(:snippet) @start_time = args[:start_time] if args.key?(:start_time) @status = args[:status] if args.key?(:status) @traffic_coverage = args[:traffic_coverage] if args.key?(:traffic_coverage) @updated = args[:updated] if args.key?(:updated) @variations = args[:variations] if args.key?(:variations) @web_property_id = args[:web_property_id] if args.key?(:web_property_id) @winner_confidence_level = args[:winner_confidence_level] if args.key?(:winner_confidence_level) @winner_found = args[:winner_found] if args.key?(:winner_found) end |