File Coverage

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