Hi Folks,
I am completely new to this google adword API, so please be patience with me. I am trying to upload offline adword conversion through adword API and I am stuck here, so I hope someone could help me getting over it.
I have the required information like GCLID and other conversion data, what I need to do is just upload it to the adword account.
I am doing it on PHP so let me list out what i have done till now.
$offlineConversionService = $adWordsServices->get($session, OfflineConversionFeedService::class);
// Associate offline conversions with the existing named conversion tracker.
// If this tracker was newly created, it may be a few hours before it can
// accept conversions.
$feed = new OfflineConversionFeed();
$feed->setConversionName($conversionName);
$feed->setConversionTime($conversionTime);
$feed->setConversionValue($conversionValue);
$feed->setGoogleClickId($gclid);
// Optional: To upload fractional conversion credits, set the external
// attribution model and credit. To use this feature, your conversion
// tracker should be marked as externally attributed. See
// https://developers.google.com/adwords/api/docs/guides/conversion-tracking#importing_externally_attributed_conversions
// to learn more about importing externally attributed conversions.
// $feed->setExternalAttributionModel('Linear');
// $feed->setExternalAttributionCredit(0.3);
$offlineConversionOperation = new OfflineConversionFeedOperation();
$offlineConversionOperation->setOperator(Operator::ADD);
$offlineConversionOperation->setOperand($feed);
$offlineConversionOperations = [$offlineConversionOperation];
$result = $offlineConversionService->mutate($offlineConversionOperations);
$feed = $result->getValue()[0];
printf(
"Uploaded offline conversion value of %d for Google Click ID = '%s' to '%s'.\n",
$feed->getConversionValue(),
$feed->getGoogleClickId(),
$feed->getConversionName()
);
What problem I have now:
1. I couldn't understand how to use above code snippet.Full implementation.
2. I couldn't find the way of linking this to my adword account. Where could i add the credentials that will link the API to my account.
Can anyone point me to the right direction? Any code snippet, explanation or supporting links would be helpful.
Thanks in advance,
Navin