File Coverage

blib/lib/Google/Ads/GoogleAds/V11/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   668 use warnings;
  1         3  
  1         30  
18 1     1   6 use base qw(Google::Ads::GoogleAds::BaseEntity);
  1         2  
  1         21  
19 1     1   4  
  1         2  
  1         59  
20             use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
21 1     1   5  
  1         3  
  1         505  
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             auctionInsightSearchAbsoluteTopImpressionPercentage =>
51             $args->{auctionInsightSearchAbsoluteTopImpressionPercentage},
52             auctionInsightSearchImpressionShare =>
53             $args->{auctionInsightSearchImpressionShare},
54             auctionInsightSearchOutrankingShare =>
55             $args->{auctionInsightSearchOutrankingShare},
56             auctionInsightSearchOverlapRate => $args->{auctionInsightSearchOverlapRate},
57             auctionInsightSearchPositionAboveRate =>
58             $args->{auctionInsightSearchPositionAboveRate},
59             auctionInsightSearchTopImpressionPercentage =>
60             $args->{auctionInsightSearchTopImpressionPercentage},
61             averageCost => $args->{averageCost},
62             averageCpc => $args->{averageCpc},
63             averageCpe => $args->{averageCpe},
64             averageCpm => $args->{averageCpm},
65             averageCpv => $args->{averageCpv},
66             averagePageViews => $args->{averagePageViews},
67             averageTimeOnSite => $args->{averageTimeOnSite},
68             benchmarkAverageMaxCpc => $args->{benchmarkAverageMaxCpc},
69             benchmarkCtr => $args->{benchmarkCtr},
70             biddableAppInstallConversions => $args->{biddableAppInstallConversions},
71             biddableAppPostInstallConversions =>
72             $args->{biddableAppPostInstallConversions},
73             bounceRate => $args->{bounceRate},
74             clicks => $args->{clicks},
75             combinedClicks => $args->{combinedClicks},
76             combinedClicksPerQuery => $args->{combinedClicksPerQuery},
77             combinedQueries => $args->{combinedQueries},
78             contentBudgetLostImpressionShare =>
79             $args->{contentBudgetLostImpressionShare},
80             contentImpressionShare => $args->{contentImpressionShare},
81             contentRankLostImpressionShare => $args->{contentRankLostImpressionShare},
82             conversionLastConversionDate => $args->{conversionLastConversionDate},
83             conversionLastReceivedRequestDateTime =>
84             $args->{conversionLastReceivedRequestDateTime},
85             conversions => $args->{conversions},
86             conversionsByConversionDate => $args->{conversionsByConversionDate},
87             conversionsFromInteractionsRate => $args->{conversionsFromInteractionsRate},
88             conversionsFromInteractionsValuePerInteraction =>
89             $args->{conversionsFromInteractionsValuePerInteraction},
90             conversionsValue => $args->{conversionsValue},
91             conversionsValueByConversionDate =>
92             $args->{conversionsValueByConversionDate},
93             conversionsValuePerCost => $args->{conversionsValuePerCost},
94             costMicros => $args->{costMicros},
95             costPerAllConversions => $args->{costPerAllConversions},
96             costPerConversion => $args->{costPerConversion},
97             costPerCurrentModelAttributedConversion =>
98             $args->{costPerCurrentModelAttributedConversion},
99             crossDeviceConversions => $args->{crossDeviceConversions},
100             ctr => $args->{ctr},
101             currentModelAttributedConversions =>
102             $args->{currentModelAttributedConversions},
103             currentModelAttributedConversionsFromInteractionsRate =>
104             $args->{currentModelAttributedConversionsFromInteractionsRate},
105             currentModelAttributedConversionsFromInteractionsValuePerInteraction =>
106             $args->
107             {currentModelAttributedConversionsFromInteractionsValuePerInteraction},
108             currentModelAttributedConversionsValue =>
109             $args->{currentModelAttributedConversionsValue},
110             currentModelAttributedConversionsValuePerCost =>
111             $args->{currentModelAttributedConversionsValuePerCost},
112             engagementRate => $args->{engagementRate},
113             engagements => $args->{engagements},
114             gmailForwards => $args->{gmailForwards},
115             gmailSaves => $args->{gmailSaves},
116             gmailSecondaryClicks => $args->{gmailSecondaryClicks},
117             historicalCreativeQualityScore => $args->{historicalCreativeQualityScore},
118             historicalLandingPageQualityScore =>
119             $args->{historicalLandingPageQualityScore},
120             historicalQualityScore => $args->{historicalQualityScore},
121             historicalSearchPredictedCtr => $args->{historicalSearchPredictedCtr},
122             hotelAverageLeadValueMicros => $args->{hotelAverageLeadValueMicros},
123             hotelCommissionRateMicros => $args->{hotelCommissionRateMicros},
124             hotelEligibleImpressions => $args->{hotelEligibleImpressions},
125             hotelExpectedCommissionCost => $args->{hotelExpectedCommissionCost},
126             hotelPriceDifferencePercentage => $args->{hotelPriceDifferencePercentage},
127             impressions => $args->{impressions},
128             impressionsFromStoreReach => $args->{impressionsFromStoreReach},
129             interactionEventTypes => $args->{interactionEventTypes},
130             interactionRate => $args->{interactionRate},
131             interactions => $args->{interactions},
132             invalidClickRate => $args->{invalidClickRate},
133             invalidClicks => $args->{invalidClicks},
134             messageChatRate => $args->{messageChatRate},
135             messageChats => $args->{messageChats},
136             messageImpressions => $args->{messageImpressions},
137             mobileFriendlyClicksPercentage => $args->{mobileFriendlyClicksPercentage},
138             optimizationScoreUplift => $args->{optimizationScoreUplift},
139             optimizationScoreUrl => $args->{optimizationScoreUrl},
140             organicClicks => $args->{organicClicks},
141             organicClicksPerQuery => $args->{organicClicksPerQuery},
142             organicImpressions => $args->{organicImpressions},
143             organicImpressionsPerQuery => $args->{organicImpressionsPerQuery},
144             organicQueries => $args->{organicQueries},
145             percentNewVisitors => $args->{percentNewVisitors},
146             phoneCalls => $args->{phoneCalls},
147             phoneImpressions => $args->{phoneImpressions},
148             phoneThroughRate => $args->{phoneThroughRate},
149             relativeCtr => $args->{relativeCtr},
150             searchAbsoluteTopImpressionShare =>
151             $args->{searchAbsoluteTopImpressionShare},
152             searchBudgetLostAbsoluteTopImpressionShare =>
153             $args->{searchBudgetLostAbsoluteTopImpressionShare},
154             searchBudgetLostImpressionShare => $args->{searchBudgetLostImpressionShare},
155             searchBudgetLostTopImpressionShare =>
156             $args->{searchBudgetLostTopImpressionShare},
157             searchClickShare => $args->{searchClickShare},
158             searchExactMatchImpressionShare => $args->{searchExactMatchImpressionShare},
159             searchImpressionShare => $args->{searchImpressionShare},
160             searchRankLostAbsoluteTopImpressionShare =>
161             $args->{searchRankLostAbsoluteTopImpressionShare},
162             searchRankLostImpressionShare => $args->{searchRankLostImpressionShare},
163             searchRankLostTopImpressionShare =>
164             $args->{searchRankLostTopImpressionShare},
165             searchTopImpressionShare => $args->{searchTopImpressionShare},
166             skAdNetworkConversions => $args->{skAdNetworkConversions},
167             speedScore => $args->{speedScore},
168             topImpressionPercentage => $args->{topImpressionPercentage},
169             validAcceleratedMobilePagesClicksPercentage =>
170             $args->{validAcceleratedMobilePagesClicksPercentage},
171             valuePerAllConversions => $args->{valuePerAllConversions},
172             valuePerAllConversionsByConversionDate =>
173             $args->{valuePerAllConversionsByConversionDate},
174             valuePerConversion => $args->{valuePerConversion},
175             valuePerConversionsByConversionDate =>
176             $args->{valuePerConversionsByConversionDate},
177             valuePerCurrentModelAttributedConversion =>
178             $args->{valuePerCurrentModelAttributedConversion},
179             videoQuartileP100Rate => $args->{videoQuartileP100Rate},
180             videoQuartileP25Rate => $args->{videoQuartileP25Rate},
181             videoQuartileP50Rate => $args->{videoQuartileP50Rate},
182             videoQuartileP75Rate => $args->{videoQuartileP75Rate},
183             videoViewRate => $args->{videoViewRate},
184             videoViews => $args->{videoViews},
185             viewThroughConversions => $args->{viewThroughConversions}};
186              
187 0           # Delete the unassigned fields in this object for a more concise JSON payload
188             remove_unassigned_fields($self, $args);
189              
190 0           bless $self, $class;
191             return $self;
192 0           }
193 0            
194             1;