examples/AdWords/v201809/Remarketing/UploadOfflineData.php
private static function createOfflineData(
        \DateTime $transactionTime,
        $transactionMicroAmount,
        $transactionCurrency,
        $conversionName,
        array $userIdentifierList
    ) {
        $storeSalesTransaction = new StoreSalesTransaction();

        // For times use the format yyyyMMdd HHmmss [tz].
        // For details, see
        // https://developers.google.com/adwords/api/docs/appendix/codes-formats#date-and-time-formats
        $storeSalesTransaction->setTransactionTime(
            $transactionTime->format('Ymd His')
        );
        $storeSalesTransaction->setConversionName($conversionName);
        $storeSalesTransaction->setUserIdentifiers($userIdentifierList);

        $money = new Money();
        $money->setMicroAmount($transactionMicroAmount);
        $moneyWithCurrency = new MoneyWithCurrency();
        $moneyWithCurrency->setMoney($money);
        $moneyWithCurrency->setCurrencyCode($transactionCurrency);
        $storeSalesTransaction->setTransactionAmount($moneyWithCurrency);

        $offlineData = new OfflineData();
        $offlineData->setStoreSalesTransaction($storeSalesTransaction);

        return $offlineData;
    }
private static function createOfflineData(
        \DateTime $transactionTime,
        $transactionMicroAmount,
        $transactionCurrency,
        $conversionName,
        array $userIdentifierList
    ) {
        $storeSalesTransaction = new StoreSalesTransaction();

        // For times use the format yyyyMMdd HHmmss [tz].
        // For details, see
        // https://developers.google.com/adwords/api/docs/appendix/codes-formats#date-and-time-formats
        $storeSalesTransaction->setTransactionTime(
            $transactionTime->format('Ymd His')
        );
        $storeSalesTransaction->setConversionName($conversionName);
        $storeSalesTransaction->setUserIdentifiers($userIdentifierList);

        $money = new Money();
        $money->setMicroAmount($transactionMicroAmount);
        $moneyWithCurrency = new MoneyWithCurrency();
        $moneyWithCurrency->setMoney($money);
        $moneyWithCurrency->setCurrencyCode($transactionCurrency);
        $storeSalesTransaction->setTransactionAmount($moneyWithCurrency);

        $offlineData = new OfflineData();
        $offlineData->setStoreSalesTransaction($storeSalesTransaction);

        return $offlineData;
    }
private static function createOfflineData ( \ DateTime $ transactionTime , $ transactionMicroAmount , $ transactionCurrency , $ conversionName , array $ userIdentifierList ) { $ storeSalesTransaction = new StoreSalesTransaction ( ) ; // For times use the format yyyyMMdd HHmmss [tz]. // For details, see // https://developers.google.com/adwords/api/docs/appendix/codes-formats#date-and-time-formats $ storeSalesTransaction -> setTransactionTime ( $ transactionTime -> format ( 'Ymd His' ) ) ; $ storeSalesTransaction -> setConversionName ( $ conversionName ) ; $ storeSalesTransaction -> setUserIdentifiers ( $ userIdentifierList ) ; $ money = new Money ( ) ; $ money -> setMicroAmount ( $ transactionMicroAmount ) ; $ moneyWithCurrency = new MoneyWithCurrency ( ) ; $ moneyWithCurrency -> setMoney ( $ money ) ; $ moneyWithCurrency -> setCurrencyCode ( $ transactionCurrency ) ; $ storeSalesTransaction -> setTransactionAmount ( $ moneyWithCurrency ) ; $ offlineData = new OfflineData ( ) ; $ offlineData -> setStoreSalesTransaction ( $ storeSalesTransaction ) ; return $ offlineData ; }
Creates the offline data from the specified transaction time, transaction
micro amount, transaction currency, conversion name and user identifier
list.
Creates the offline data from the specified transaction time transaction micro amount transaction currency conversion name and user identifier list .