I am trying to use the UploadConversion API and it seems to be working, 
some of the conversions are getting imported, but when my script should 
display the results i get the following error:
Can't locate object method "get_value" via package 
"Google::Ads::AdWords::v201402::OfflineConversionFeed".
Valid methods are:
 at /usr/local/share/perl5/SOAP/WSDL/XSD/Typelib/ComplexType.pm line 68.
SOAP::WSDL::XSD::Typelib::ComplexType::AUTOMETHOD(Google::Ads::AdWords::v201402::OfflineConversionFeed=SCALAR(0x4332530),
 
70460720) called at /usr/local/share/perl5/Class/Std.pm line 545
Class::Std::AUTOLOAD(Google::Ads::AdWords::v201402::OfflineConversionFeed=SCALAR(0x4332530))
 
called at ./importgclids.pl line 78

I am using a modified version of the upload_offline_conversions.pl example:
    my $clientSettings = &const::GoogleAPIClient();
    my $client = Google::Ads::AdWords::Client->new({version => "v201402"});
    $client->set_developer_token($clientSettings->{developer_token});
    
$client->get_oauth_2_handler()->set_client_id($clientSettings->{client_id});
    
$client->get_oauth_2_handler()->set_client_secret($clientSettings->{client_secret});
    
$client->get_oauth_2_handler()->set_access_token($GoogleAccountConnection->{access_token});
    
$client->get_oauth_2_handler()->set_refresh_token($GoogleAccountConnection->{refresh_token});
    
    my @search;
    push(@search, "a1.exported=0");
    push(@search, "a2.agent_id='$agent_id'");
    push(@search, "a2.status='approve'");
    push(@search, 
"DATE_FORMAT(a2.stamp,'%y%m%d')<=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 
DAY),'%y%m%d')");
    my $search = join(" AND ", @search);
    
    my @orders;
    my $orders = &db::select_rows("SELECT a1.id, a1.gclid, 
DATE_FORMAT(a2.stamp, '%Y%m%d %H%i%s') as stamp, 
(a2.pay_for_lead+a2.pay_for_sale) as value, conversionName FROM 
gclid_order_log a1 JOIN lead_log a2 ON a1.lead_log_id=a2.record_id WHERE 
$search");
    while (my $order = $orders->fetchrow_hashref()) {
        $order->{conversionName} = $agent->{conversionName} if 
(!$order->{conversionName});
        $order->{action} = "ADD";
        
        if ($order->{conversionName}) {
            print "$order->{action}, $order->{gclid}, 
$order->{conversionName}, $order->{value}, $order->{stamp}\n";
            
            my $feed = 
Google::Ads::AdWords::v201402::OfflineConversionFeed->new({
                conversionName => $order->{conversionName},
                conversionTime => $order->{stamp} ." Europe/Copenhagen",
                conversionValue => $order->{value},
                googleClickId => $order->{gclid}
            });
            
            my $offline_conversion_operation = 
Google::Ads::AdWords::v201402::OfflineConversionFeedOperation->new({
                operator => "ADD",
                operand => $feed
            });
            push(@orders, $offline_conversion_operation);
        }
    }
    
    if (scalar@orders>0) {
        # Add the upload conversion.
        my $feed_result = $client->OfflineConversionFeedService()->mutate({
            operations => \@orders
        });
        
        # Display results.
        if ($feed_result->get_value()) {
            foreach my $oc_feed (@{$feed_result->get_value()}) {           
     
                printf "Uploaded offline conversion value of \"%s\" for 
Google Click ID \"%d\" was created.\n", $oc_feed->get_name(), 
$oc_feed->get_id();
            }
        } else {
            print "No offline conversion were added.\n";
        }
    } else {
        print "No conversions to add.";
    }

What am i doing wrong here?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to