4.1.5 전환 추적

가치 및 비즈니스 영향


판매자 클라이언트 광고 캠페인에 Google 생태계의 강력한 머신러닝 및 분석을 효과적으로 제공하려면 클라이언트 웹사이트에 전환 추적 및 리마케팅 태그를 배치해야 합니다.

Google Ads의 전환은 사용자가 광고를 클릭한 후 제품 구매, 모바일 앱 설치, 이메일 목록 가입 등 지정된 액션을 수행하는 것을 말합니다. 전환 추적은 고객이 광고 지출을 집중할 영역을 결정하는 데 도움이 되도록 투자수익 (ROI)을 계산하고 비교하는 정보 등 광고를 조회하거나 클릭한 사용자의 액션에 대한 주요 정보를 제공합니다. 또한 추적을 통해 데이터를 조정 목적으로 사용할 수도 있습니다. 주문은 제품 또는 카테고리에 따라 다르므로 특정 등록정보 그룹이 판매로 전환되는 방식을 보여주는 데도 전환 추적을 사용할 수 있습니다.

전환 목표는 기본 목표가 동일한 전환 액션 그룹입니다. 예를 들어 '구매'는 '웹사이트 구매'와 '매장 판매'를 전환 액션으로 포함하는 전환 목표가 될 수 있습니다.

전환 액션은 전환을 추적하고 캠페인을 최적화하는 데 계속 사용됩니다. 전환 액션을 만들고 전환 목표에서 이러한 액션을 Google 그룹으로 묶습니다.

구매 전환 액션

여기에 설명된 전환 추적을 구현하면 판매자의 Google Ads 계정에서 구매 전환수 및 이러한 전환의 가치를 측정할 수 있습니다. 전환 추적을 사용하지 않으면 ROAS (광고 투자수익) 측면에서 캠페인이 유도하는 비즈니스 가치를 측정할 수 없습니다. 또한 캠페인의 실적을 최적화할 수 있도록 추가 데이터 신호를 전송합니다.

기타 전환 액션

구매 전환 액션만 필요하지만 추가 전환 액션을 추적하면 판매자에게 유용한 정보를 더 얻을 수 있습니다. 핵심 전환 액션을 최대한 많이 구현하면서 최대한 모든 항목을 로깅하는 것이 좋습니다. 권장 전환 액션의 전체 목록은 Tech API 안내 섹션에 설명되어 있습니다.

일반적으로 다음을 캡처하는 것이 좋습니다.

  • 값과 직접 연결된 성공 이벤트
  • add_to_cart, sign_up과 같이 핵심 전환에 기여하는 성공 이벤트입니다.
  • 광고주가 최종 사용자와의 소통 방식을 이해하는 데 도움이 되는 참여 및 사용자 상호작용

보조 전환 액션은 관찰 및 보고 전용이며 입찰에 영향을 미칩니다.기본 및 보조 전환 액션에 대해 자세히 알아보기

UX 안내


오류 위험을 최소화하려면 판매자 입력 없이 프로그래매틱 방식으로 전환 추적을 구현하는 것이 좋지만, 판매자가 전환 추적이 설정되었음을 알고 있어야 합니다.

판매자가 기존 Google Ads 계정을 연결할 때는 해결해야 할 충돌이 있을 수 있으므로 계정에 이미 전환 추적이 설정되었을 수 있다는 알림을 표시하는 것이 좋습니다. 아래 예를 참고하세요.

connect_your_google_ads_account

기술 가이드


전환 추적이 작동하는 방식은 다음과 같습니다. 이 섹션에서는 각 단계에 대해 자세히 설명합니다.

  1. 판매자의 Google Ads 계정에서 'ConversionAction'을 만들어 웹사이트에서 이루어진 구매 (및 다른 고객 액션 포함)를 추적할 수 있습니다.

  2. 웹사이트나 모바일 앱에 해당 전환 액션에 대한 태그 또는 코드 스니펫을 추가합니다. 자세한 내용은 웹사이트에 전환 추적 설정하기를 참고하세요.

  3. 고객이 광고를 클릭하면 고객의 컴퓨터나 휴대기기에 임시 쿠키가 저장됩니다.

  4. 고객이 광고주에 대해 정의된 작업을 완료하면 Google에서 추가된 코드 스니펫을 통해 쿠키를 인식하고, 필요한 경우 'value'와 같은 다른 매개변수와 함께 전환을 기록합니다.

자격 요건

시작하기 전에 Google 태그 개발자 ID가 있는지 확인하세요. Google 태그 개발자 ID가 없는 경우 Google 태그 개발자 ID 요청 양식을 작성하세요. 개발자 ID는 최종 사용자가 웹사이트 측정 코드에 추가하는 측정 ID, 전환 ID와 같은 다른 ID와 다릅니다.

전환 액션 만들기 및 구성하기

다음 예는 전환 액션을 만들고 Google Ads 계정에 추가하는 방법을 보여줍니다. 각 샘플은 모든 백그라운드 인증 작업을 처리하고 전환 액션을 만드는 과정을 안내합니다.

Java

// Copyright 2018 Google LLC
//
// 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
//
//     https://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 com.google.ads.googleads.examples.remarketing;

import static com.google.ads.googleads.examples.utils.CodeSampleHelper.getPrintableDateTime;

import com.beust.jcommander.Parameter;
import com.google.ads.googleads.examples.utils.ArgumentNames;
import com.google.ads.googleads.examples.utils.CodeSampleParams;
import com.google.ads.googleads.lib.GoogleAdsClient;
import com.google.ads.googleads.v17.enums.ConversionActionCategoryEnum.ConversionActionCategory;
import com.google.ads.googleads.v17.enums.ConversionActionStatusEnum.ConversionActionStatus;
import com.google.ads.googleads.v17.enums.ConversionActionTypeEnum.ConversionActionType;
import com.google.ads.googleads.v17.errors.GoogleAdsError;
import com.google.ads.googleads.v17.errors.GoogleAdsException;
import com.google.ads.googleads.v17.resources.ConversionAction;
import com.google.ads.googleads.v17.resources.ConversionAction.ValueSettings;
import com.google.ads.googleads.v17.services.ConversionActionOperation;
import com.google.ads.googleads.v17.services.ConversionActionServiceClient;
import com.google.ads.googleads.v17.services.MutateConversionActionResult;
import com.google.ads.googleads.v17.services.MutateConversionActionsResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Collections;

/** Adds a conversion action. */
public class AddConversionAction {

  private static class AddConversionActionParams extends CodeSampleParams {

    @Parameter(names = ArgumentNames.CUSTOMER_ID, required = true)
    private Long customerId;
  }

  public static void main(String[] args) {
    AddConversionActionParams params = new AddConversionActionParams();
    if (!params.parseArguments(args)) {

      // Either pass the required parameters for this example on the command line, or insert them
      // into the code here. See the parameter class definition above for descriptions.
      params.customerId = Long.parseLong("INSERT_CUSTOMER_ID_HERE");
    }

    GoogleAdsClient googleAdsClient = null;
    try {
      googleAdsClient = GoogleAdsClient.newBuilder().fromPropertiesFile().build();
    } catch (FileNotFoundException fnfe) {
      System.err.printf(
          "Failed to load GoogleAdsClient configuration from file. Exception: %s%n", fnfe);
      System.exit(1);
    } catch (IOException ioe) {
      System.err.printf("Failed to create GoogleAdsClient. Exception: %s%n", ioe);
      System.exit(1);
    }

    try {
      new AddConversionAction().runExample(googleAdsClient, params.customerId);
    } catch (GoogleAdsException gae) {
      // GoogleAdsException is the base class for most exceptions thrown by an API request.
      // Instances of this exception have a message and a GoogleAdsFailure that contains a
      // collection of GoogleAdsErrors that indicate the underlying causes of the
      // GoogleAdsException.
      System.err.printf(
          "Request ID %s failed due to GoogleAdsException. Underlying errors:%n",
          gae.getRequestId());
      int i = 0;
      for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) {
        System.err.printf("  Error %d: %s%n", i++, googleAdsError);
      }
      System.exit(1);
    }
  }

  /**
   * Runs the example.
   *
   * @param googleAdsClient the Google Ads API client.
   * @param customerId the client customer ID.
   * @throws GoogleAdsException if an API request failed with one or more service errors.
   */
  private void runExample(GoogleAdsClient googleAdsClient, long customerId) {

    // Creates a ConversionAction.
    ConversionAction conversionAction =
        ConversionAction.newBuilder()
            // Note that conversion action names must be unique. If a conversion action already
            // exists with the specified conversion_action_name the create operation will fail with
            // a ConversionActionError.DUPLICATE_NAME error.
            .setName("Earth to Mars Cruises Conversion #" + getPrintableDateTime())
            .setCategory(ConversionActionCategory.DEFAULT)
            .setType(ConversionActionType.WEBPAGE)
            .setStatus(ConversionActionStatus.ENABLED)
            .setViewThroughLookbackWindowDays(15L)
            .setValueSettings(
                ValueSettings.newBuilder()
                    .setDefaultValue(23.41)
                    .setAlwaysUseDefaultValue(true)
                    .build())
            .build();

    // Creates the operation.
    ConversionActionOperation operation =
        ConversionActionOperation.newBuilder().setCreate(conversionAction).build();

    try (ConversionActionServiceClient conversionActionServiceClient =
        googleAdsClient.getLatestVersion().createConversionActionServiceClient()) {
      MutateConversionActionsResponse response =
          conversionActionServiceClient.mutateConversionActions(
              Long.toString(customerId), Collections.singletonList(operation));
      System.out.printf("Added %d conversion actions:%n", response.getResultsCount());
      for (MutateConversionActionResult result : response.getResultsList()) {
        System.out.printf(
            "New conversion action added with resource name: '%s'%n", result.getResourceName());
      }
    }
  }
}

      

C#

// Copyright 2019 Google LLC
//
// 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.

using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V17.Errors;
using Google.Ads.GoogleAds.V17.Resources;
using Google.Ads.GoogleAds.V17.Services;
using System;
using static Google.Ads.GoogleAds.V17.Enums.ConversionActionCategoryEnum.Types;
using static Google.Ads.GoogleAds.V17.Enums.ConversionActionStatusEnum.Types;
using static Google.Ads.GoogleAds.V17.Enums.ConversionActionTypeEnum.Types;

namespace Google.Ads.GoogleAds.Examples.V17
{
    /// <summary>
    /// This code example illustrates adding a conversion action.
    /// </summary>
    public class AddConversionAction : ExampleBase
    {
        /// <summary>
        /// Command line options for running the <see cref="AddConversionAction"/> example.
        /// </summary>
        public class Options : OptionsBase
        {
            /// <summary>
            /// The Google Ads customer ID for which the conversion action is added.
            /// </summary>
            [Option("customerId", Required = true, HelpText =
                "The Google Ads customer ID for which the conversion action is added.")]
            public long CustomerId { get; set; }
        }

        /// <summary>
        /// Main method, to run this code example as a standalone application.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        public static void Main(string[] args)
        {
            Options options = ExampleUtilities.ParseCommandLine<Options>(args);

            AddConversionAction codeExample = new AddConversionAction();
            Console.WriteLine(codeExample.Description);
            codeExample.Run(new GoogleAdsClient(), options.CustomerId);
        }

        /// <summary>
        /// Returns a description about the code example.
        /// </summary>
        public override string Description =>
            "This code example illustrates adding a conversion action.";

        /// <summary>
        /// Runs the code example.
        /// </summary>
        /// <param name="client">The Google Ads client.</param>
        /// <param name="customerId">The Google Ads customer ID for which the conversion action is
        /// added.</param>
        public void Run(GoogleAdsClient client, long customerId)
        {
            // Get the ConversionActionService.
            ConversionActionServiceClient conversionActionService =
                client.GetService(Services.V17.ConversionActionService);

            // Note that conversion action names must be unique.
            // If a conversion action already exists with the specified name the create operation
            // will fail with a ConversionAction.DUPLICATE_NAME error.
            string ConversionActionName = "Earth to Mars Cruises Conversion #"
                + ExampleUtilities.GetRandomString();

            // Add a conversion action.
            ConversionAction conversionAction = new ConversionAction()
            {
                Name = ConversionActionName,
                Category = ConversionActionCategory.Default,
                Type = ConversionActionType.Webpage,
                Status = ConversionActionStatus.Enabled,
                ViewThroughLookbackWindowDays = 15,
                ValueSettings = new ConversionAction.Types.ValueSettings()
                {
                    DefaultValue = 23.41,
                    AlwaysUseDefaultValue = true
                }
            };

            // Create the operation.
            ConversionActionOperation operation = new ConversionActionOperation()
            {
                Create = conversionAction
            };

            try
            {
                // Create the conversion action.
                MutateConversionActionsResponse response =
                    conversionActionService.MutateConversionActions(customerId.ToString(),
                            new ConversionActionOperation[] { operation });

                // Display the results.
                foreach (MutateConversionActionResult newConversionAction in response.Results)
                {
                    Console.WriteLine($"New conversion action with resource name = " +
                        $"'{newConversionAction.ResourceName}' was added.");
                }
            }
            catch (GoogleAdsException e)
            {
                Console.WriteLine("Failure:");
                Console.WriteLine($"Message: {e.Message}");
                Console.WriteLine($"Failure: {e.Failure}");
                Console.WriteLine($"Request ID: {e.RequestId}");
                throw;
            }
        }
    }
}

      

2,399필리핀

<?php

/**
 * Copyright 2018 Google LLC
 *
 * 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
 *
 *     https://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.
 */

namespace Google\Ads\GoogleAds\Examples\Remarketing;

require __DIR__ . '/../../vendor/autoload.php';

use GetOpt\GetOpt;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentNames;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentParser;
use Google\Ads\GoogleAds\Examples\Utils\Helper;
use Google\Ads\GoogleAds\Lib\V17\GoogleAdsClient;
use Google\Ads\GoogleAds\Lib\V17\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Lib\V17\GoogleAdsException;
use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\V17\Enums\ConversionActionCategoryEnum\ConversionActionCategory;
use Google\Ads\GoogleAds\V17\Enums\ConversionActionStatusEnum\ConversionActionStatus;
use Google\Ads\GoogleAds\V17\Enums\ConversionActionTypeEnum\ConversionActionType;
use Google\Ads\GoogleAds\V17\Errors\GoogleAdsError;
use Google\Ads\GoogleAds\V17\Resources\ConversionAction;
use Google\Ads\GoogleAds\V17\Resources\ConversionAction\ValueSettings;
use Google\Ads\GoogleAds\V17\Services\ConversionActionOperation;
use Google\Ads\GoogleAds\V17\Services\MutateConversionActionsRequest;
use Google\ApiCore\ApiException;

/** This example illustrates adding a conversion action. */
class AddConversionAction
{
    private const CUSTOMER_ID = 'INSERT_CUSTOMER_ID_HERE';

    public static function main()
    {
        // Either pass the required parameters for this example on the command line, or insert them
        // into the constants above.
        $options = (new ArgumentParser())->parseCommandArguments([
            ArgumentNames::CUSTOMER_ID => GetOpt::REQUIRED_ARGUMENT
        ]);

        // Generate a refreshable OAuth2 credential for authentication.
        $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();

        // Construct a Google Ads client configured from a properties file and the
        // OAuth2 credentials above.
        $googleAdsClient = (new GoogleAdsClientBuilder())
            ->fromFile()
            ->withOAuth2Credential($oAuth2Credential)
            // We set this value to true to show how to use GAPIC v2 source code. You can remove the
            // below line if you wish to use the old-style source code. Note that in that case, you
            // probably need to modify some parts of the code below to make it work.
            // For more information, see
            // https://developers.devsite.corp.google.com/google-ads/api/docs/client-libs/php/gapic.
            ->usingGapicV2Source(true)
            ->build();

        try {
            self::runExample(
                $googleAdsClient,
                $options[ArgumentNames::CUSTOMER_ID] ?: self::CUSTOMER_ID
            );
        } catch (GoogleAdsException $googleAdsException) {
            printf(
                "Request with ID '%s' has failed.%sGoogle Ads failure details:%s",
                $googleAdsException->getRequestId(),
                PHP_EOL,
                PHP_EOL
            );
            foreach ($googleAdsException->getGoogleAdsFailure()->getErrors() as $error) {
                /** @var GoogleAdsError $error */
                printf(
                    "\t%s: %s%s",
                    $error->getErrorCode()->getErrorCode(),
                    $error->getMessage(),
                    PHP_EOL
                );
            }
            exit(1);
        } catch (ApiException $apiException) {
            printf(
                "ApiException was thrown with message '%s'.%s",
                $apiException->getMessage(),
                PHP_EOL
            );
            exit(1);
        }
    }

    /**
     * Runs the example.
     *
     * @param GoogleAdsClient $googleAdsClient the Google Ads API client
     * @param int $customerId the customer ID
     */
    public static function runExample(GoogleAdsClient $googleAdsClient, int $customerId)
    {
        // Creates a conversion action.
        $conversionAction = new ConversionAction([
            // Note that conversion action names must be unique.
            // If a conversion action already exists with the specified conversion_action_name
            // the create operation will fail with a ConversionActionError.DUPLICATE_NAME error.
            'name' => 'Earth to Mars Cruises Conversion #' . Helper::getPrintableDatetime(),
            'category' => ConversionActionCategory::PBDEFAULT,
            'type' => ConversionActionType::WEBPAGE,
            'status' => ConversionActionStatus::ENABLED,
            'view_through_lookback_window_days' => 15,
            'value_settings' => new ValueSettings([
                'default_value' => 23.41,
                'always_use_default_value' => true
            ])
        ]);

        // Creates a conversion action operation.
        $conversionActionOperation = new ConversionActionOperation();
        $conversionActionOperation->setCreate($conversionAction);

        // Issues a mutate request to add the conversion action.
        $conversionActionServiceClient = $googleAdsClient->getConversionActionServiceClient();
        $response = $conversionActionServiceClient->mutateConversionActions(
            MutateConversionActionsRequest::build($customerId, [$conversionActionOperation])
        );

        printf("Added %d conversion actions:%s", $response->getResults()->count(), PHP_EOL);

        foreach ($response->getResults() as $addedConversionAction) {
            /** @var ConversionAction $addedConversionAction */
            printf(
                "New conversion action added with resource name: '%s'%s",
                $addedConversionAction->getResourceName(),
                PHP_EOL
            );
        }
    }
}

AddConversionAction::main();

      

Python

#!/usr/bin/env python
# Copyright 2018 Google LLC
#
# 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
#
#     https://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.
"""This example illustrates adding a conversion action."""


import argparse
import sys
import uuid

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException


def main(client, customer_id):
    conversion_action_service = client.get_service("ConversionActionService")

    # Create the operation.
    conversion_action_operation = client.get_type("ConversionActionOperation")

    # Create conversion action.
    conversion_action = conversion_action_operation.create

    # Note that conversion action names must be unique. If a conversion action
    # already exists with the specified conversion_action_name, the create
    # operation will fail with a ConversionActionError.DUPLICATE_NAME error.
    conversion_action.name = f"Earth to Mars Cruises Conversion {uuid.uuid4()}"
    conversion_action.type_ = (
        client.enums.ConversionActionTypeEnum.UPLOAD_CLICKS
    )
    conversion_action.category = (
        client.enums.ConversionActionCategoryEnum.DEFAULT
    )
    conversion_action.status = client.enums.ConversionActionStatusEnum.ENABLED
    conversion_action.view_through_lookback_window_days = 15

    # Create a value settings object.
    value_settings = conversion_action.value_settings
    value_settings.default_value = 15.0
    value_settings.always_use_default_value = True

    # Add the conversion action.
    conversion_action_response = (
        conversion_action_service.mutate_conversion_actions(
            customer_id=customer_id,
            operations=[conversion_action_operation],
        )
    )

    print(
        "Created conversion action "
        f'"{conversion_action_response.results[0].resource_name}".'
    )


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Adds a conversion action for specified customer."
    )
    # The following argument(s) should be provided to run the example.
    parser.add_argument(
        "-c",
        "--customer_id",
        type=str,
        required=True,
        help="The Google Ads customer ID.",
    )
    args = parser.parse_args()

    # GoogleAdsClient will read the google-ads.yaml configuration file in the
    # home directory if none is specified.
    googleads_client = GoogleAdsClient.load_from_storage(version="v17")

    try:
        main(googleads_client, args.customer_id)
    except GoogleAdsException as ex:
        print(
            f'Request with ID "{ex.request_id}" failed with status '
            f'"{ex.error.code().name}" and includes the following errors:'
        )
        for error in ex.failure.errors:
            print(f'\tError with message "{error.message}".')
            if error.location:
                for field_path_element in error.location.field_path_elements:
                    print(f"\t\tOn field: {field_path_element.field_name}")
        sys.exit(1)

      

Ruby

#!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright 2018 Google LLC
#
# 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
#
#     https://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.
#
# This code example illustrates adding a conversion action.

require 'optparse'
require 'google/ads/google_ads'
require 'date'

def add_conversion_action(customer_id)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new


  # Add a conversion action.
  conversion_action = client.resource.conversion_action do |ca|
    ca.name = "Earth to Mars Cruises Conversion #{(Time.new.to_f * 100).to_i}"
    ca.type = :UPLOAD_CLICKS
    ca.category = :DEFAULT
    ca.status = :ENABLED
    ca.view_through_lookback_window_days = 15

    # Create a value settings object.
    ca.value_settings = client.resource.value_settings do |vs|
      vs.default_value = 15
      vs.always_use_default_value = true
    end
  end

  # Create the operation.
  conversion_action_operation = client.operation.create_resource.conversion_action(conversion_action)

  # Add the ad group ad.
  response = client.service.conversion_action.mutate_conversion_actions(
    customer_id: customer_id,
    operations: [conversion_action_operation],
  )

  puts "New conversion action with resource name = #{response.results.first.resource_name}."
end

if __FILE__ == $0
  options = {}
  # The following parameter(s) should be provided to run the example. You can
  # either specify these by changing the INSERT_XXX_ID_HERE values below, or on
  # the command line.
  #
  # Parameters passed on the command line will override any parameters set in
  # code.
  #
  # Running the example with -h will print the command line usage.
  options[:customer_id] = 'INSERT_CUSTOMER_ID_HERE'

  OptionParser.new do |opts|
    opts.banner = sprintf('Usage: %s [options]', File.basename(__FILE__))

    opts.separator ''
    opts.separator 'Options:'

    opts.on('-C', '--customer-id CUSTOMER-ID', String, 'Customer ID') do |v|
      options[:customer_id] = v
    end

    opts.separator ''
    opts.separator 'Help:'

    opts.on_tail('-h', '--help', 'Show this message') do
      puts opts
      exit
    end
  end.parse!

  begin
    add_conversion_action(options.fetch(:customer_id).tr("-", ""))
  rescue Google::Ads::GoogleAds::Errors::GoogleAdsError => e
    e.failure.errors.each do |error|
      STDERR.printf("Error with message: %s\n", error.message)
      if error.location
        error.location.field_path_elements.each do |field_path_element|
          STDERR.printf("\tOn field: %s\n", field_path_element.field_name)
        end
      end
      error.error_code.to_h.each do |k, v|
        next if v == :UNSPECIFIED
        STDERR.printf("\tType: %s\n\tCode: %s\n", k, v)
      end
    end
    raise
  end
end

      

Perl

#!/usr/bin/perl -w
#
# Copyright 2019, Google LLC
#
# 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.
#
# This example illustrates adding a conversion action.

use strict;
use warnings;
use utf8;

use FindBin qw($Bin);
use lib "$Bin/../../lib";
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::V17::Resources::ConversionAction;
use Google::Ads::GoogleAds::V17::Resources::ValueSettings;
use Google::Ads::GoogleAds::V17::Enums::ConversionActionCategoryEnum
  qw(DEFAULT);
use Google::Ads::GoogleAds::V17::Enums::ConversionActionTypeEnum   qw(WEBPAGE);
use Google::Ads::GoogleAds::V17::Enums::ConversionActionStatusEnum qw(ENABLED);
use
  Google::Ads::GoogleAds::V17::Services::ConversionActionService::ConversionActionOperation;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
use Cwd          qw(abs_path);
use Data::Uniqid qw(uniqid);

# The following parameter(s) should be provided to run the example. You can
# either specify these by changing the INSERT_XXX_ID_HERE values below, or on
# the command line.
#
# Parameters passed on the command line will override any parameters set in
# code.
#
# Running the example with -h will print the command line usage.
my $customer_id = "INSERT_CUSTOMER_ID_HERE";

sub add_conversion_action {
  my ($api_client, $customer_id) = @_;

  # Note that conversion action names must be unique.
  # If a conversion action already exists with the specified conversion_action_name,
  # the create operation fails with error ConversionActionError.DUPLICATE_NAME.
  my $conversion_action_name = "Earth to Mars Cruises Conversion #" . uniqid();

  # Create a conversion action.
  my $conversion_action =
    Google::Ads::GoogleAds::V17::Resources::ConversionAction->new({
      name                          => $conversion_action_name,
      category                      => DEFAULT,
      type                          => WEBPAGE,
      status                        => ENABLED,
      viewThroughLookbackWindowDays => 15,
      valueSettings                 =>
        Google::Ads::GoogleAds::V17::Resources::ValueSettings->new({
          defaultValue          => 23.41,
          alwaysUseDefaultValue => "true"
        })});

  # Create a conversion action operation.
  my $conversion_action_operation =
    Google::Ads::GoogleAds::V17::Services::ConversionActionService::ConversionActionOperation
    ->new({create => $conversion_action});

  # Add the conversion action.
  my $conversion_actions_response =
    $api_client->ConversionActionService()->mutate({
      customerId => $customer_id,
      operations => [$conversion_action_operation]});

  printf "New conversion action added with resource name: '%s'.\n",
    $conversion_actions_response->{results}[0]{resourceName};

  return 1;
}

# Don't run the example if the file is being included.
if (abs_path($0) ne abs_path(__FILE__)) {
  return 1;
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);

# Parameters passed on the command line will override any parameters set in code.
GetOptions("customer_id=s" => \$customer_id);

# Print the help message if the parameters are not initialized in the code nor
# in the command line.
pod2usage(2) if not check_params($customer_id);

# Call the example.
add_conversion_action($api_client, $customer_id =~ s/-//gr);

=pod

=head1 NAME

add_conversion_action

=head1 DESCRIPTION

This example illustrates adding a conversion action.

=head1 SYNOPSIS

add_conversion_action.pl [options]

    -help                       Show the help message.
    -customer_id                The Google Ads customer ID.

=cut

      

위의 예는 일반적인 내용이므로 실적 최대화 캠페인에 맞게 ConversionAction을 올바르게 구성하기 위한 추가 정보를 확인하세요. 각 전환 액션은 다음과 같이 구성해야 합니다.

  • 유형 - 이러한 구매 이벤트는 웹사이트에서 발생하므로 ConversionActionType을 WEBPAGE로 설정합니다.

  • 입찰 가능 – 기본 전환 액션 (구매)을 true로 설정하여 판매를 기준으로 캠페인을 최적화합니다. 보조 전환 액션 (예: 장바구니에 추가)의 경우 값을 false로 설정합니다.

  • 카테고리 - 각 전환 액션 (기본 또는 보조)에 대해 ConversionActionCategory를 설정합니다. 아래에서 권장하는 전환 액션 7개에 해당하는 대화 액션 카테고리를 확인할 수 있습니다. Google Ads는 카테고리를 기준으로 표준 전환 목표에 전환 액션을 자동으로 할당합니다. 예를 들어 구매 전환 액션은 '구매'라는 표준 전환 목표에 할당됩니다. 나중에 이 구매 목표에 최적화되도록 실적 최대화 캠페인을 구성할 수 있습니다.

추천 전환 액션 목록은 아래에 나와 있습니다. 처음 4개의 전환 액션과 기타 권장 액션을 가능한 한 많이 구현하는 것이 좋습니다.

온라인 판매와 관련된 추가 이벤트를 구현할 수도 있습니다. 보다 세부적인 추적을 위해 전환 액션이나 맞춤설정된 전환 액션을 만들 수도 있습니다 (예: 사용자가 웹사이트에서 검색 옵션을 사용할 때마다 '결제 정보 추가' 액션 또는 사용자가 웹사이트에서 검색 옵션을 사용할 때마다 '검색' 액션). 보조 전환 액션은 판매자에 대한 추가 추적을 제공하며 Google Ads에서 관찰에 사용합니다.

우선순위 전환 액션 전환 액션 카테고리 Google 태그 이벤트 이름 설명
필수 구매 구매 purchase 사용자가 구매를 완료합니다.
모든 상점 개발자에게 적극 권장됨 장바구니에 추가 ADD_TO_CART add_to_cart 사용자가 장바구니에 제품을 추가합니다.
모든 상점 개발자에게 적극 권장됨 결제 시작 BEGIN_CHECKOUT begin_checkout 사용자가 결제 프로세스를 시작함
모든 상점 개발자에게 적극 권장됨 상품 보기 PAGE_VIEW page_view 사용자가 제품 페이지를 엽니다.
해당하는 경우 적극 권장 (일반적으로 매장 제작업체에는 적용되지 않음) 가입 가입 sign_up 사용자가 계정에 가입함
해당하는 경우 적극 권장 (일반적으로 매장 제작업체에는 적용되지 않음) 리드 생성 SUBMIT_LEAD_FORM generate_lead 사용자가 양식을 통해 리드 생성
해당하는 경우 적극 권장 (일반적으로 매장 제작업체에는 적용되지 않음) 구독 SUBSCRIBE_PAID 해당 없음 (맞춤) 사용자가 유료 서비스를 구독합니다.
해당하는 경우 적극 권장 (일반적으로 매장 제작업체에는 적용되지 않음) 예약 BOOK_APPOINTMENT 해당 없음 (맞춤) 사용자가 일정을 예약합니다.
해당하는 경우 적극 권장 (일반적으로 매장 제작업체에는 적용되지 않음) 견적 요청 REQUEST_QUOTE 해당 없음 (맞춤) 사용자가 예상 가격을 요청하는 양식을 제출함

기존 Google Ads 계정이 있는 판매자

판매자가 기존 Google Ads 계정에 온보딩할 수 있도록 허용하는 경우 계정에 이미 전환 액션이 있는 상황이 발생할 수 있습니다. 기존 전환 액션은 전환이 올바르게 설정되었다는 보장이 없으므로 사용하지 않는 것이 좋습니다. 또한 이러한 잠재적 시나리오를 처리하려면 추가 단계를 수행해야 합니다.

  • 계정에 '계정 기본값'으로 표시된 여러 목표 (예: 구매 + 페이지 조회수 + 연락처)가 있습니다. 새 캠페인을 만들면 기본적으로 이러한 모든 목표를 기준으로 최적화됩니다. 실적 최대화 캠페인에서는 이 기능을 사용하지 않아도 됩니다.

  • 계정에 구매 추적을 위한 전환 액션이 하나 이상 있고 구매 목표에 이미 그룹화되어 있습니다. 즉, 전환 태그가 2개 실행되므로 캠페인에서 구매 건수가 2배로 집계됩니다.

실적 최대화 캠페인에서 맞춤 전환 액션과 해당 액션만 사용하도록 하려면 다음 단계를 따르세요.

  1. CustomConversionGoal을 만들고 구매 전환 액션을 목표의 conversion_actions[] 목록에 추가합니다. 상태를 사용 설정됨으로 설정합니다.

  2. 실적 최대화 캠페인의 ConversionGoalCampaignConfig에서 custom_conversion_goal를 (1)단계에서 만든 맞춤 목표로 설정합니다.

  3. (2)단계의 결과로 Google Ads에서 캠페인의 ConversionGoalCampaignConfig를 자동으로 업데이트하여 goal_config_levelCAMPAIGN (계정의 기본 목표를 사용하도록 지시하는 CUSTOMER 대신)로 설정되었어야 하지만, 실제로 발생한 것인지 한 번 더 확인하는 것이 좋습니다.

전환 액션 태그 가져오기

전환 액션을 만든 후에는 태그라는 해당하는 코드 스니펫을 광고주 웹사이트의 전환 페이지에 삽입해야 합니다. Google Ads에서 고객의 브라우저에 관계없이 모든 전환을 측정할 수 있도록 하려면 업데이트된 Google Ads 전환 추적 태그를 사용하세요. 이 태그는 다음 두 부분으로 구성됩니다.

  • global_site_tag - 광고주 웹사이트의 모든 페이지에 설치되어야 합니다.

  • event_snippet: 결제 확인 또는 리드 제출 페이지와 같은 전환 액션을 나타내는 웹페이지에 배치해야 합니다.

ConversionActionService를 사용하여 이 두 부분을 가져올 수 있습니다.

태그는 고객의 고유 식별자 또는 고객의 사이트 방문을 유도한 광고 클릭을 저장하는 쿠키를 설정합니다. 이 쿠키는 전환 추적 태그에 포함된 Google 클릭 식별자 (GCLID) 매개변수로부터 광고 클릭 정보를 수신합니다. 광고주의 웹사이트와 리드 추적 시스템에서 Google Ads가 Google 광고의 모든 노출에 제공하는 고유 ID인 GCLID를 캡처하고 저장하도록 설정해야 합니다.

전체 태그 및 설치 위치에 대해 자세히 알아보기

Google 태그 (gtag.js)는 Google Ads와 Google 애널리틱스 모두에 이벤트 데이터를 전송할 수 있는 태그 지정 프레임워크 및 API입니다. 전체 사이트 태그는 이벤트 스니펫 또는 전화 스니펫과 함께 작동하여 전환을 추적합니다. 광고주 사이트에서 모든 페이지의 <head> 섹션에 Google 태그를 추가하고 Google Ads와 함께 작동하도록 구성합니다. 그런 다음 gtag() 명령어를 사용하여 이벤트를 캡처하고 데이터를 Google Ads로 전송할 수 있습니다. 자세한 내용은 Google Ads 전환 추적에 전체 사이트 태그 사용을 참고하세요.

Google 태그와 함께 다음 명령어를 사용합니다.

  • config: Google 제품 (Google Ads, 애널리틱스 등)을 초기화하고, 설정을 구성하고, 계정에 데이터를 전송할 준비를 합니다.

  • 이벤트: 구매 (권장) 또는 장바구니에 추가(보조 전환 액션)와 같은 이벤트를 전송하여 전환을 등록합니다. gtag.js 이벤트 참조 가이드를 검토해 보시기 바랍니다.

  • set: 페이지의 모든 이벤트에 공통된 매개변수(예: 통화)를 설정합니다.

다음 예는 Google Ads에 데이터를 전송하는 전체 사이트 태그의 JavaScript 코드 스니펫입니다. GOOGLE_CONVERSION_ID 자리표시자 값은 단일 광고주 계정의 고유한 숫자 ID입니다.

<!-- Google Tag (gtag.js) - Google Ads: GOOGLE_CONVERSION_ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-GOOGLE_CONVERSION_ID">
</script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments)};
  gtag('js', new Date());
   gtag('set', 'developer_id.<developer ID>', true); // Replace with your Google tag Developer ID
  gtag('config', 'AW-GOOGLE_CONVERSION_ID');
</script>

Google 태그 스니펫은 페이지당 한 번만 표시되어야 합니다. 기존 gtag.js 인스턴스가 있는 경우 기존 태그에 새 태그 ID를 추가해야 합니다. 여러 계정에 데이터를 전송하려면 사용 중인 모든 계정에 대해 'config' 명령에 대한 호출을 추가하여 다음 예와 같이 각 계정의 전환 ID를 지정합니다.

<!-- Google Tag (gtag.js) - Google Ads: GOOGLE_CONVERSION_ID_1 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-GOOGLE_CONVERSION_ID_1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments)};
  gtag('js', new Date());
  gtag('config', 'AW-GOOGLE_CONVERSION_ID_1');
  gtag('config', 'AW-GOOGLE_CONVERSION_ID_2');
</script>

이벤트 스니펫 및 설치 위치에 대한 추가 정보

구매 전환 추적이 작동하려면 전환 페이지 자체에 구매 이벤트 스니펫을 설치해야 합니다. 일반적으로 주문 확인 페이지입니다. 전체 태그 스니펫 뒤, 코드 내 어디에나 배치할 수 있습니다. 보조 전환 액션(예: 장바구니에 추가)의 이벤트 스니펫은 각 페이지에 배치해야 합니다.

아래의 샘플 스니펫에서 AW-CONVERSION_IDgTag_developer_ID는 Google Ads 계정 및 Google 태그 개발자 계정에 고유한 전환 ID를 나타내고, AW-CONVERSION_LABEL은 전환 액션별로 고유한 전환 라벨을 나타냅니다.

<!-- Event snippet for a purchase conversion page -->
<script>
  gtag('event', 'conversion', {
       'send_to':'AW-CONVERSION_ID/CONVERSION_LABEL',
       'developer_id.<gTag developer ID>': true,
       'transaction_id': '<transaction_id (string)>' //unique ID for the transaction (e.g. an order ID); it's used for de-duplication purposes
       'value': 1.0,
       'currency': 'USD', //three-letter currency code, useful for advertisers who accept multiple currencies
       'country': 'US',
       'new_customer': false, //new customer acquisition goal
       'tax': 1.24, //tax cost-US only
       'shipping': 0.00, //shipping cost-US only
       'delivery_postal_code': '94043', //shipping data validation-US only
       'estimated_delivery_date': '2020-07-31', //shipping validation-US only
       'aw_merchant_id': 12345, //shipping validation-US only
       'aw_feed_country': 'US', //shipping validation-US only
       'aw_feed_language': 'EN', //shipping validation-US only
       'items': [
       {
             'id': 'P12345',
             'name': 'Android Warhol T-Shirt',
             'quantity': 2,
             'price': 12.04,
             'estimated_delivery_date': '2020-07-31', //shipping-US only
              'google_business_vertical': 'retail'
       }, …],
  });
</script>

일부 매개변수는 선택사항이지만 이벤트별로 최대한 많은 정보를 포함하는 것이 좋습니다. 각 이벤트 유형에 사용할 수 있는 매개변수에 대해 자세히 알아보세요.

매개변수는 사용자가 웹사이트 또는 앱과 상호작용하는 방식에 관한 추가 정보를 제공합니다.

클릭(예: AJAX를 사용하는 사이트의 버튼 또는 동적 응답)을 기준으로 전환 이벤트를 측정하려는 경우 다음 스니펫을 대신 사용할 수도 있습니다.

<!-- Event snippet for test conversion click -->
In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->
<script>
function gtag_report_conversion(url) {
  var callback = function () {
    if (typeof(url) != 'undefined') {
      window.location = url;
    }
  };
  gtag('event', 'conversion', {
      'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL',
      'value': 1.0,
      'event_callback': callback,
      //other parameters
  });
  return false;
}
</script>

Google 태그에는 사용자 동의를 관리하기 위한 Consent API가 기본으로 포함되어 있습니다. 광고 목적의 쿠키에 대한 사용자 동의와 분석 목적의 사용자 동의를 구분할 수 있습니다.

예상되는 결과는 고객이 별도로 취해야 할 조치 없이 최소한 gtag('consent', 'update' {...}) 호출을 통합하게 됩니다. 이렇게 해야 Google 태그(Google Ads, 플러드라이트, Google 애널리틱스, 전환 링커)가 최신 사용자 동의 상태를 읽고 &gcs 매개변수를 통해 Google에 보내는 네트워크 요청에 상태를 포함할 수 있습니다.

추가 구현 단계는 동의 모드에서 동의 인식 방식으로 태그를 실행하도록 사용 설정하기 위해 gtag('consent', default' {...}) 상태를 배포하고(예: UI를 통해) Google 태그를 배포하고 차단 해제 (예: 동의 기반 조건부 실행 없음)하도록 지원하는 것입니다.

구현에 관한 자세한 내용은 동의 설정 관리하기 (웹)를 참고하세요.

Google Ads 관리자 계정에서 단일 전환 코드 태그를 사용하여 모든 광고주 계정의 전환을 추적할 수 있습니다. 교차 계정 전환 추적을 참고하세요.

전환 추적 구현이 제대로 작동하는지 테스트하는 가장 좋은 방법은 판매자의 웹사이트 중 하나 (또는 내부 테스트 웹사이트)를 방문하여 실제 구매를 하는 것입니다. 그런 다음 Google Tag Assistant 도구에서 이 문제 해결 가이드를 사용하여 Google Ads에서 태그를 인식했고 전환을 기록 중인지 확인할 수 있습니다. 추가적인 문제 해결 방법은 사이트 전체 태그 문제 해결하기를 참고하세요.

위의 전환 태그를 향상된 전환으로 보완하여 전환 측정의 정확성을 개선하고 입찰의 효과를 높일 수 있습니다. 향상된 전환 설정에 대해 자세히 알아보세요. 향상된 전환을 구현하기 전에 판매자가 Google Ads의 향상된 전환 고객 데이터 정책을 준수할 수 있는지 확인해야 합니다.