Conversion Upload : how to set conversion window on each conversion upload?

35 views
Skip to first unread message

Akhil V V

unread,
Jul 9, 2019, 6:28:45 AM7/9/19
to AdWords API and Google Ads API Forum
I'm trying to upload conversions using OfflineConversionFeed. I wanted to set conversion window =90 days for each conversion. I believe this can be set by using ctcLookbackWindow however that function is not listed in the document - https://developers.google.com/adwords/api/docs/reference/v201809/OfflineConversionFeedService.OfflineConversionFeed

Has anyone tried this before? Is it possible to set conversion window on each conversion upload?

    $feed = new OfflineConversionFeed();
    $feed->setconversionName($conversionName);
    $feed->setconversionTime($conversionTime);
    $feed->setconversionValue($conversionValue);
    $feed->setgoogleClickId($gClId);

    $offlineConversionOperation = new OfflineConversionFeedOperation();
    $offlineConversionOperation->setOperator(Operator::ADD);
    $offlineConversionOperation->setOperand($feed);
    $offlineConversionOperations = array($offlineConversionOperation);
    $result = $offlineConversionService->mutate($offlineConversionOperations);
    $feed = $result->value[0];

Akhil V V

unread,
Jul 9, 2019, 6:28:47 AM7/9/19
to AdWords API and Google Ads API Forum

Google Ads API Forum Advisor Prod

unread,
Jul 9, 2019, 11:42:54 PM7/9/19
to adwor...@googlegroups.com
Hi Akhil,

The ctcLookBackWindow can only be modified using the ConversionTrackerService. Also, please note that this is only editable for AdWords Conversions and Upload Conversions.

Thanks and regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UCbm8s:ref

Akhil V V

unread,
Jul 10, 2019, 7:27:06 AM7/10/19
to adsapifor...@gmail.com, adwor...@googlegroups.com
Thanks Peter! I actually had modified the ctcLookBackWindow while creating conversion action (which I believe is a one time action) however I want to set conversion window every time I fire a conversion through GCLID. 
The issue is that whenever I fire a conversion through API, the conversion window is getting set to 1 day instead of 90 days. Due to this the conversions on our DB doesnt match with Google ads. So as a solution I want to send conversion window = 90 days on every pixel fires. 

Please see my code below

$adWordsConversionTracker->setStatus(ConversionTrackerStatus::ENABLED);
        $adWordsConversionTracker->setCategory(
            ConversionTrackerCategory::DEFAULT_VALUE
        );
        $adWordsConversionTracker->setViewthroughLookbackWindow(15);
        $adWordsConversionTracker->setCtcLookbackWindow(90);
        // $adWordsConversionTracker->setDefaultRevenueValue(23.41);
        // $adWordsConversionTracker->setAlwaysUseDefaultRevenueValue(true);
        $conversionTrackers[] = $adWordsConversionTracker;

        // Create conversion tracker operations and add them to the list.
        $operations = [];
        foreach ($conversionTrackers as $conversionTracker) {
            $operation = new ConversionTrackerOperation();
            $operation->setOperand($conversionTracker);
            $operation->setOperator(Operator::ADD);
            $operations[] = $operation;
        }

        // Create the conversion trackers on the server.
        $result = $conversionTrackerService->mutate($operations);

        // Print out some information about created trackers.

       $conversionName  = 'API Conversions';
       $conversionTime  = '20190709 120902 GMT';
       $conversionValue = '1';
       $gClId           = 'EAIaIQobChMIq7vOpOWn4wIVC_lRChldksldksklAAYAyAAEgJQYfD_BwE';


 $feed = new OfflineConversionFeed();
        $feed->setconversionName($conversionName);
        $feed->setconversionTime($conversionTime);
        $feed->setconversionValue($conversionValue);
        $feed->setgoogleClickId($gClId);
       
        $offlineConversionOperation = new OfflineConversionFeedOperation();
        $offlineConversionOperation->setOperator(Operator::ADD);
        $offlineConversionOperation->setOperand($feed);
        $offlineConversionOperations = array($offlineConversionOperation);
        $result = $offlineConversionService->mutate($offlineConversionOperations);

Is it possible to use ctcLookBackWindow anywhere on the highlight section?

Please let me know your thoughts. Thanks

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/UQs--000000000000000000000000000000000000000000000PUEQAZ00C4qyEaRDRPGDpaD9s8cKMg%40sfdc.net.


--
Thanks,
Akhil V V
Reply all
Reply to author
Forward
0 new messages