File Coverage

blib/lib/Google/Ads/GoogleAds/V10/Common/Metrics.pm
Criterion Covered Total %
statement 12 17 70.5
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 23 69.5


line stmt bran cond sub pod time code
1             # Copyright 2020, Google LLC
2             #
3             # Licensed under the Apache License, Version 2.0 (the "License");
4             # you may not use this file except in compliance with the License.
5             # You may obtain a copy of the License at
6             #
7             # http://www.apache.org/licenses/LICENSE-2.0
8             #
9             # Unless required by applicable law or agreed to in writing, software
10             # distributed under the License is distributed on an "AS IS" BASIS,
11             # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12             # See the License for the specific language governing permissions and
13             # limitations under the License.
14              
15              
16             use strict;
17 1     1   700 use warnings;
  1         1  
  1         22  
18 1     1   5 use base qw(Google::Ads::GoogleAds::BaseEntity);
  1         1  
  1         30  
19 1     1   5  
  1         2  
  1         50  
20             use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
21 1     1   6  
  1         7  
  1         470  
22             my ($class, $args) = @_;
23             my $self = {
24 0     0 0   absoluteTopImpressionPercentage => $args->{absoluteTopImpressionPercentage},
25             activeViewCpm => $args->{activeViewCpm},
26             activeViewCtr => $args->{activeViewCtr},
27             activeViewImpressions => $args->{activeViewImpressions},
28             activeViewMeasurability => $args->{activeViewMeasurability},
29             activeViewMeasurableCostMicros => $args->{activeViewMeasurableCostMicros},
30             activeViewMeasurableImpressions => $args->{activeViewMeasurableImpressions},
31             activeViewViewability => $args->{activeViewViewability},
32             allConversions => $args->{allConversions},
33             allConversionsByConversionDate => $args->{allConversionsByConversionDate},
34             allConversionsFromClickToCall => $args->{allConversionsFromClickToCall},
35             allConversionsFromDirections => $args->{allConversionsFromDirections},
36             allConversionsFromInteractionsRate =>
37             $args->{allConversionsFromInteractionsRate},
38             allConversionsFromInteractionsValuePerInteraction =>
39             $args->{allConversionsFromInteractionsValuePerInteraction},
40             allConversionsFromMenu => $args->{allConversionsFromMenu},
41             allConversionsFromOrder => $args->{allConversionsFromOrder},
42             allConversionsFromOtherEngagement =>
43             $args->{allConversionsFromOtherEngagement},
44             allConversionsFromStoreVisit => $args->{allConversionsFromStoreVisit},
45             allConversionsFromStoreWebsite => $args->{allConversionsFromStoreWebsite},
46             allConversionsValue => $args->{allConversionsValue},
47             allConversionsValueByConversionDate =>
48             $args->{allConversionsValueByConversionDate},
49             allConversionsValuePerCost => $args->{allConversionsValuePerCost},
50             averageCost => $args->{averageCost},
51             averageCpc => $args->{averageCpc},
52             averageCpe => $args->{averageCpe},
53             averageCpm => $args->{averageCpm},
54             averageCpv => $args->{averageCpv},
55             averagePageViews => $args->{averagePageViews},
56             averageTimeOnSite => $args->{averageTimeOnSite},
57             benchmarkAverageMaxCpc => $args->{benchmarkAverageMaxCpc},
58             benchmarkCtr => $args->{benchmarkCtr},
59             biddableAppInstallConversions => $args->{biddableAppInstallConversions},
60             biddableAppPostInstallConversions =>
61             $args->{biddableAppPostInstallConversions},
62             bounceRate => $args->{bounceRate},
63             clicks => $args->{clicks},
64             combinedClicks => $args->{combinedClicks},
65             combinedClicksPerQuery => $args->{combinedClicksPerQuery},
66             combinedQueries => $args->{combinedQueries},
67             contentBudgetLostImpressionShare =>
68             $args->{contentBudgetLostImpressionShare},
69             contentImpressionShare => $args->{contentImpressionShare},
70             contentRankLostImpressionShare => $args->{contentRankLostImpressionShare},
71             conversionLastConversionDate => $args->{conversionLastConversionDate},
72             conversionLastReceivedRequestDateTime =>
73             $args->{conversionLastReceivedRequestDateTime},
74             conversions => $args->{conversions},
75             conversionsByConversionDate => $args->{conversionsByConversionDate},
76             conversionsFromInteractionsRate => $args->{conversionsFromInteractionsRate},
77             conversionsFromInteractionsValuePerInteraction =>
78             $args->{conversionsFromInteractionsValuePerInteraction},
79             conversionsValue => $args->{conversionsValue},
80             conversionsValueByConversionDate =>
81             $args->{conversionsValueByConversionDate},
82             conversionsValuePerCost => $args->{conversionsValuePerCost},
83             costMicros => $args->{costMicros},
84             costPerAllConversions => $args->{costPerAllConversions},
85             costPerConversion => $args->{costPerConversion},
86             costPerCurrentModelAttributedConversion =>
87             $args->{costPerCurrentModelAttributedConversion},
88             crossDeviceConversions => $args->{crossDeviceConversions},
89             ctr => $args->{ctr},
90             currentModelAttributedConversions =>
91             $args->{currentModelAttributedConversions},
92             currentModelAttributedConversionsFromInteractionsRate =>
93             $args->{currentModelAttributedConversionsFromInteractionsRate},
94             currentModelAttributedConversionsFromInteractionsValuePerInteraction =>
95             $args->
96             {currentModelAttributedConversionsFromInteractionsValuePerInteraction},
97             currentModelAttributedConversionsValue =>
98             $args->{currentModelAttributedConversionsValue},
99             currentModelAttributedConversionsValuePerCost =>
100             $args->{currentModelAttributedConversionsValuePerCost},
101             engagementRate => $args->{engagementRate},
102             engagements => $args->{engagements},
103             gmailForwards => $args->{gmailForwards},
104             gmailSaves => $args->{gmailSaves},
105             gmailSecondaryClicks => $args->{gmailSecondaryClicks},
106             historicalCreativeQualityScore => $args->{historicalCreativeQualityScore},
107             historicalLandingPageQualityScore =>
108             $args->{historicalLandingPageQualityScore},
109             historicalQualityScore => $args->{historicalQualityScore},
110             historicalSearchPredictedCtr => $args->{historicalSearchPredictedCtr},
111             hotelAverageLeadValueMicros => $args->{hotelAverageLeadValueMicros},
112             hotelCommissionRateMicros => $args->{hotelCommissionRateMicros},
113             hotelEligibleImpressions => $args->{hotelEligibleImpressions},
114             hotelExpectedCommissionCost => $args->{hotelExpectedCommissionCost},
115             hotelPriceDifferencePercentage => $args->{hotelPriceDifferencePercentage},
116             impressions => $args->{impressions},
117             impressionsFromStoreReach => $args->{impressionsFromStoreReach},
118             interactionEventTypes => $args->{interactionEventTypes},
119             interactionRate => $args->{interactionRate},
120             interactions => $args->{interactions},
121             invalidClickRate => $args->{invalidClickRate},
122             invalidClicks => $args->{invalidClicks},
123             messageChatRate => $args->{messageChatRate},
124             messageChats => $args->{messageChats},
125             messageImpressions => $args->{messageImpressions},
126             mobileFriendlyClicksPercentage => $args->{mobileFriendlyClicksPercentage},
127             optimizationScoreUplift => $args->{optimizationScoreUplift},
128             optimizationScoreUrl => $args->{optimizationScoreUrl},
129             organicClicks => $args->{organicClicks},
130             organicClicksPerQuery => $args->{organicClicksPerQuery},
131             organicImpressions => $args->{organicImpressions},
132             organicImpressionsPerQuery => $args->{organicImpressionsPerQuery},
133             organicQueries => $args->{organicQueries},
134             percentNewVisitors => $args->{percentNewVisitors},
135             phoneCalls => $args->{phoneCalls},
136             phoneImpressions => $args->{phoneImpressions},
137             phoneThroughRate => $args->{phoneThroughRate},
138             relativeCtr => $args->{relativeCtr},
139             searchAbsoluteTopImpressionShare =>
140             $args->{searchAbsoluteTopImpressionShare},
141             searchBudgetLostAbsoluteTopImpressionShare =>
142             $args->{searchBudgetLostAbsoluteTopImpressionShare},
143             searchBudgetLostImpressionShare => $args->{searchBudgetLostImpressionShare},
144             searchBudgetLostTopImpressionShare =>
145             $args->{searchBudgetLostTopImpressionShare},
146             searchClickShare => $args->{searchClickShare},
147             searchExactMatchImpressionShare => $args->{searchExactMatchImpressionShare},
148             searchImpressionShare => $args->{searchImpressionShare},
149             searchRankLostAbsoluteTopImpressionShare =>
150             $args->{searchRankLostAbsoluteTopImpressionShare},
151             searchRankLostImpressionShare => $args->{searchRankLostImpressionShare},
152             searchRankLostTopImpressionShare =>
153             $args->{searchRankLostTopImpressionShare},
154             searchTopImpressionShare => $args->{searchTopImpressionShare},
155             skAdNetworkConversions => $args->{skAdNetworkConversions},
156             speedScore => $args->{speedScore},
157             topImpressionPercentage => $args->{topImpressionPercentage},
158             validAcceleratedMobilePagesClicksPercentage =>
159             $args->{validAcceleratedMobilePagesClicksPercentage},
160             valuePerAllConversions => $args->{valuePerAllConversions},
161             valuePerAllConversionsByConversionDate =>
162             $args->{valuePerAllConversionsByConversionDate},
163             valuePerConversion => $args->{valuePerConversion},
164             valuePerConversionsByConversionDate =>
165             $args->{valuePerConversionsByConversionDate},
166             valuePerCurrentModelAttributedConversion =>
167             $args->{valuePerCurrentModelAttributedConversion},
168             videoQuartileP100Rate => $args->{videoQuartileP100Rate},
169             videoQuartileP25Rate => $args->{videoQuartileP25Rate},
170             videoQuartileP50Rate => $args->{videoQuartileP50Rate},
171             videoQuartileP75Rate => $args->{videoQuartileP75Rate},
172             videoViewRate => $args->{videoViewRate},
173             videoViews => $args->{videoViews},
174             viewThroughConversions => $args->{viewThroughConversions}};
175              
176 0           # Delete the unassigned fields in this object for a more concise JSON payload
177             remove_unassigned_fields($self, $args);
178              
179 0           bless $self, $class;
180             return $self;
181 0           }
182 0            
183             1;