AdWords
2.4K members online now
2.4K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Import offline converstion on Adword Test MCC account

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I am trying to import my real Offline conversions on my TEST MCC account using PHP client library of Google Adword. But every time I am trying to import conversion using UploadOfflineConverstions.php,it is showing me An error has occurred:[OfflineConversionError.CONVERSION_PRECEDES_CLICK @ operations[0].operand] .

 

Problem could be that the actual GCLID time is not matching on our Test MCC account GCLID time (actually no GCLID exists on my Test MCC account).

 

The code I have used pasted below.

 

<?php
/**
 * This code example imports offline conversion values for specific clicks to
 * your account. To get Google Click ID for a click, run
 * CLICK_PERFORMANCE_REPORT. To set up a conversion tracker, run the
 * AddConversionTracker.php example.
 *
 * Restriction: adwords-only
 *
 * Copyright 2016, Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @package    GoogleApiAdsAdWords
 * @subpackage v201603
 * @category   WebServices
 * @copyright  2016, Google Inc. All Rights Reserved.
 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache License,
 *             Version 2.0
 */

// Include the initialization file.
require_once dirname(dirname(__FILE__)) . '/init.php';

// Enter parameters required by the code example.
$conversionName = 'XXXXX';
$gclid = 'CjwKEAjwmf6-BRDi9fSN7Ijt1wUSJAASawcjkzS4cPTZQdAjQINY71s9lEapx0oQcRrfju84jRbC6RoCz1Tw_wcB';
$conversionTime = '20160814 130000 Asia/Dhaka';
$conversionValue = '5.95';

/**8
 * Runs the example.
 * @param AdWordsUser $user the user to run the example with
 * @param string $campaignId the ID of the campaign to add the sitelinks to
 */
function UploadOfflineConversionsExample(AdWordsUser $user, $conversionName,$gclid, $conversionTime, $conversionValue) {

  // Get the services, which loads the required classes.
  $offlineConversionService = $user->GetService('OfflineConversionFeedService',ADWORDS_VERSION);

  // 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->conversionName = $conversionName;
  $feed->conversionTime = $conversionTime;
  $feed->conversionValue = $conversionValue;
  $feed->googleClickId = $gclid;

  $offlineConversionOperation = new OfflineConversionFeedOperation();
  $offlineConversionOperation->operator = 'ADD';
  $offlineConversionOperation->operand = $feed;

  $offlineConversionOperations = array($offlineConversionOperation);
  $result = $offlineConversionService->mutate($offlineConversionOperations);

  $feed = $result->value[0];
  printf('Uploaded offline conversion value of %d for Google Click ID = ' .
      "'%s' to '%s'.", $feed->conversionValue, $feed->googleClickId,
      $feed->conversionName);
}



try {
  // Get AdWordsUser from credentials in "../auth.ini"
  // relative to the AdWordsUser.php file's directory.
  $user = new AdWordsUser();

  // Log every SOAP XML request and response.
  $user->LogAll();

  // Run the example.
  UploadOfflineConversionsExample($user, $conversionName, $gclid,
      $conversionTime, $conversionValue);
} catch (OAuth2Exception $e) {
  ExampleUtils::CheckForOAuth2Errors($e);
} catch (ValidationException $e) {
  ExampleUtils::CheckForOAuth2Errors($e);
} catch (Exception $e) {
  printf("An error has occurred: %s\n", $e->getMessage());
}

 

So, Now I have some questions

 

1) How can I import my real offline conversion on my TEST MCC account?

2) Is there any way to track test Ad click on my TEST MCC account so that I can import corresponding GCLID conversion later for it.

 

 

Re: Import offline converstion on Adword Test MCC account

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆
Hi @sarah_R,

What do you mean by "test account"? GCLID data can only be imported into AdWords if there is an actual import conversion goal setup in an active adwords account. You cannot do so with a non-functioning AdWords account.

Next, if the account is not running, that means no one is clicking on AdWords paid ads, meaning no GCLID is being assigned, meaning there is no offline conversion data to be imported.

Thus, your question is confusing me. Can you please clarify what it is you are trying to do? Test an API script that will auto upload the GCLID data?

Nick