4.1.5 Theo dõi lượt chuyển đổi

Giá trị và tác động đối với doanh nghiệp


Để cung cấp hiệu quả công nghệ học máy và phân tích mạnh mẽ của hệ sinh thái Google cho chiến dịch quảng cáo của khách hàng là người bán, bạn cần đặt thẻ theo dõi lượt chuyển đổi và thẻ tái tiếp thị trên trang web của khách hàng.

Lượt chuyển đổi trong Google Ads là khi người dùng thực hiện một hành động cụ thể nào đó sau khi nhấp vào quảng cáo, chẳng hạn như mua sản phẩm, cài đặt ứng dụng di động hoặc đăng ký tham gia danh sách email. Tính năng Theo dõi lượt chuyển đổi cung cấp thông tin chi tiết chính về các hành động của người dùng sau khi xem hoặc nhấp vào quảng cáo, bao gồm cả thông tin để tính toán và so sánh lợi tức đầu tư (ROI) nhằm giúp khách hàng đưa ra quyết định về nơi tập trung chi tiêu quảng cáo. Tính năng theo dõi cũng giúp đảm bảo rằng dữ liệu có sẵn cho mục đích điều chỉnh. Số đơn đặt hàng khác nhau tuỳ thuộc vào sản phẩm hoặc danh mục, vì vậy, tính năng theo dõi lượt chuyển đổi cũng có thể hữu ích để cho biết mức độ chuyển đổi của một số nhóm trang thông tin cụ thể thành lượt bán hàng.

Mục tiêu lượt chuyển đổi là một nhóm hành động chuyển đổi có cùng mục tiêu cơ bản. Ví dụ: "Giao dịch mua" có thể là một mục tiêu lượt chuyển đổi có "Giao dịch mua trên trang web" và "Lượt bán hàng tại cửa hàng thực tế" làm hành động chuyển đổi.

Hành động chuyển đổi vẫn được dùng để theo dõi lượt chuyển đổi và tối ưu hoá chiến dịch. Bạn tạo hành động chuyển đổi và Google sẽ nhóm các hành động đó trong mục tiêu chuyển đổi.

Hành động chuyển đổi giao dịch mua

Việc triển khai tính năng theo dõi lượt chuyển đổi được mô tả ở đây cho phép tài khoản Google Ads của người bán đo lường số lượt chuyển đổi Giao dịch mua và giá trị của các lượt chuyển đổi này. Nếu không có tính năng theo dõi lượt chuyển đổi, bạn sẽ không thể đo lường giá trị kinh doanh mà chiến dịch đang mang lại về mặt ROAS (lợi tức trên chi tiêu quảng cáo). Tính năng này cũng gửi thêm các tín hiệu dữ liệu để giúp chiến dịch tối ưu hoá hiệu suất.

Các hành động chuyển đổi khác

Mặc dù bạn chỉ cần có hành động chuyển đổi giao dịch mua, nhưng việc theo dõi các hành động chuyển đổi khác có thể cung cấp thêm thông tin chi tiết cho người bán. Bạn nên ghi lại mọi thứ có thể, đồng thời triển khai nhiều hành động chuyển đổi cốt lõi nhất có thể. Danh sách đầy đủ các hành động chuyển đổi được đề xuất được mô tả trong phần Hướng dẫn về API công nghệ.

Nhìn chung, bạn nên chụp những thông tin sau:

  • Mọi sự kiện thành công đều liên kết trực tiếp với giá trị
  • Các sự kiện thành công đóng góp vào lượt chuyển đổi chính, chẳng hạn như add_to_cart và sign_up.
  • Lượt tương tác và lượt tương tác của người dùng giúp nhà quảng cáo hiểu được cách họ thu hút người dùng cuối

Hành động chuyển đổi phụ chỉ dùng để quan sát và báo cáo, không ảnh hưởng đến chiến lược đặt giá thầu.Tìm hiểu thêm về hành động chuyển đổi chính và phụ.

Hướng dẫn về trải nghiệm người dùng


Để giảm thiểu nguy cơ xảy ra lỗi, bạn nên triển khai tính năng theo dõi lượt chuyển đổi bằng cách lập trình mà không cần nhà bán hàng cung cấp thông tin, nhưng bạn phải đảm bảo rằng nhà bán hàng biết rằng bạn đã thiết lập tính năng theo dõi lượt chuyển đổi.

Khi người bán liên kết một tài khoản Google Ads hiện có, bạn nên hiển thị thông báo cho họ biết rằng tài khoản của họ có thể đã thiết lập tính năng theo dõi lượt chuyển đổi, vì có thể có xung đột cần được giải quyết. Sau đây là ví dụ.

connect_your_google_ads_account

Hướng dẫn kỹ thuật


Dưới đây là cách hoạt động của tính năng theo dõi lượt chuyển đổi. Phần này trình bày chi tiết hơn về từng bước:

  1. Bạn tạo một "ConversionAction" trong tài khoản Google Ads của người bán để theo dõi các giao dịch mua (và các hành động khác của khách hàng nếu muốn) được thực hiện trên trang web của họ.

  2. Bạn thêm thẻ hoặc đoạn mã cho hành động chuyển đổi đó vào trang web hoặc ứng dụng dành cho thiết bị di động. Để biết thông tin chi tiết, hãy xem bài viết Thiết lập tính năng theo dõi lượt chuyển đổi cho trang web.

  3. Khi khách hàng nhấp vào quảng cáo, một cookie tạm thời sẽ được đặt trên máy tính hoặc thiết bị di động của khách hàng.

  4. Khi khách hàng hoàn tất hành động được xác định cho nhà quảng cáo, Google sẽ nhận dạng cookie (thông qua đoạn mã đã thêm) và ghi lại một lượt chuyển đổi cùng với các thông số khác như "value" (giá trị) nếu thích hợp.

Điều kiện tiên quyết

Trước khi bắt đầu, hãy đảm bảo bạn có Mã nhà phát triển thẻ Google. Nếu bạn không có mã nhận dạng nhà phát triển thẻ Google, hãy điền vào biểu mẫu yêu cầu mã nhận dạng nhà phát triển thẻ Google. Mã nhà phát triển của bạn khác với các mã khác, chẳng hạn như Mã đo lường hoặc Mã chuyển đổi mà người dùng cuối thêm vào mã đo lường trang web của họ.

Tạo và định cấu hình hành động chuyển đổi

Các ví dụ sau đây cho biết cách tạo hành động chuyển đổi và thêm hành động đó vào tài khoản Google Ads. Mỗi mẫu xử lý tất cả các tác vụ xác thực trong nền cho bạn và hướng dẫn bạn tạo một hành động chuyển đổi:

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.v20.enums.ConversionActionCategoryEnum.ConversionActionCategory;
import com.google.ads.googleads.v20.enums.ConversionActionStatusEnum.ConversionActionStatus;
import com.google.ads.googleads.v20.enums.ConversionActionTypeEnum.ConversionActionType;
import com.google.ads.googleads.v20.errors.GoogleAdsError;
import com.google.ads.googleads.v20.errors.GoogleAdsException;
import com.google.ads.googleads.v20.resources.ConversionAction;
import com.google.ads.googleads.v20.resources.ConversionAction.ValueSettings;
import com.google.ads.googleads.v20.services.ConversionActionOperation;
import com.google.ads.googleads.v20.services.ConversionActionServiceClient;
import com.google.ads.googleads.v20.services.MutateConversionActionResult;
import com.google.ads.googleads.v20.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.V20.Errors;
using Google.Ads.GoogleAds.V20.Resources;
using Google.Ads.GoogleAds.V20.Services;
using System;
using static Google.Ads.GoogleAds.V20.Enums.ConversionActionCategoryEnum.Types;
using static Google.Ads.GoogleAds.V20.Enums.ConversionActionStatusEnum.Types;
using static Google.Ads.GoogleAds.V20.Enums.ConversionActionTypeEnum.Types;

namespace Google.Ads.GoogleAds.Examples.V20
{
    /// <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.V20.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;
            }
        }
    }
}

      

PHP

<?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\V20\GoogleAdsClient;
use Google\Ads\GoogleAds\Lib\V20\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Lib\V20\GoogleAdsException;
use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\V20\Enums\ConversionActionCategoryEnum\ConversionActionCategory;
use Google\Ads\GoogleAds\V20\Enums\ConversionActionStatusEnum\ConversionActionStatus;
use Google\Ads\GoogleAds\V20\Enums\ConversionActionTypeEnum\ConversionActionType;
use Google\Ads\GoogleAds\V20\Errors\GoogleAdsError;
use Google\Ads\GoogleAds\V20\Resources\ConversionAction;
use Google\Ads\GoogleAds\V20\Resources\ConversionAction\ValueSettings;
use Google\Ads\GoogleAds\V20\Services\ConversionActionOperation;
use Google\Ads\GoogleAds\V20\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)
            ->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="v20")

    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'
require_relative '../shared/error_handler.rb'

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
    GoogleAdsErrorHandler.handle_google_ads_error(e)
    raise # Re-raise the error to maintain original script behavior.
  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::V20::Resources::ConversionAction;
use Google::Ads::GoogleAds::V20::Resources::ValueSettings;
use Google::Ads::GoogleAds::V20::Enums::ConversionActionCategoryEnum
  qw(DEFAULT);
use Google::Ads::GoogleAds::V20::Enums::ConversionActionTypeEnum   qw(WEBPAGE);
use Google::Ads::GoogleAds::V20::Enums::ConversionActionStatusEnum qw(ENABLED);
use
  Google::Ads::GoogleAds::V20::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::V20::Resources::ConversionAction->new({
      name                          => $conversion_action_name,
      category                      => DEFAULT,
      type                          => WEBPAGE,
      status                        => ENABLED,
      viewThroughLookbackWindowDays => 15,
      valueSettings                 =>
        Google::Ads::GoogleAds::V20::Resources::ValueSettings->new({
          defaultValue          => 23.41,
          alwaysUseDefaultValue => "true"
        })});

  # Create a conversion action operation.
  my $conversion_action_operation =
    Google::Ads::GoogleAds::V20::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

      

Vì các ví dụ trước đây mang tính chung chung, nên sau đây là một số lưu ý bổ sung để bạn có thể định cấu hình ConversionAction cho chiến dịch Tối đa hoá hiệu suất một cách chính xác. Bạn nên định cấu hình từng hành động chuyển đổi như sau:

  • Loại – Đặt ConversionActionType thành WEBPAGE, vì các sự kiện mua hàng này đang diễn ra trên một trang web.

  • Có thể đặt giá thầu – Đặt thành true cho hành động chuyển đổi chính (giao dịch mua) để tối ưu hoá chiến dịch nhằm tăng doanh số bán hàng. Đối với hành động chuyển đổi phụ (ví dụ: thêm vào giỏ hàng), hãy đặt giá trị thành false.

  • Danh mục – Đối với mỗi hành động chuyển đổi (chính hoặc phụ),hãy đặt ConversionActionCategory. Dưới đây, bạn có thể tìm thấy danh mục hành động trong cuộc trò chuyện phù hợp cho từng hành động chuyển đổi trong số 7 hành động chuyển đổi mà bạn nên triển khai. Xin lưu ý rằng Google Ads sẽ tự động chỉ định hành động chuyển đổi cho một mục tiêu lượt chuyển đổi chuẩn dựa trên danh mục của hành động đó. Ví dụ: hành động chuyển đổi giao dịch mua được chỉ định cho mục tiêu lượt chuyển đổi chuẩn có tên là "Giao dịch mua". Sau đó, bạn có thể định cấu hình chiến dịch Tối đa hoá hiệu suất để tối ưu hoá cho mục tiêu Giao dịch mua này.

Bạn có thể xem danh sách các hành động chuyển đổi được đề xuất ở bên dưới. Bạn nên triển khai ít nhất 4 hành động chuyển đổi đầu tiên và nhiều hành động được đề xuất khác nhất có thể.

Bạn cũng có thể cân nhắc triển khai các sự kiện khác có liên quan đến hoạt động bán hàng trên mạng. Để theo dõi chi tiết hơn nữa, bạn cũng có thể tạo thêm hành động chuyển đổi hoặc hành động chuyển đổi tuỳ chỉnh (ví dụ: hành động "thêm thông tin thanh toán" mỗi khi người dùng sử dụng tuỳ chọn tìm kiếm trên trang web hoặc hành động "tìm kiếm" mỗi khi người dùng sử dụng tuỳ chọn tìm kiếm trên trang web). Hành động chuyển đổi phụ cung cấp thông tin theo dõi bổ sung cho người bán và được Google Ads sử dụng để quan sát.

Mức độ ưu tiên Hành động chuyển đổi Danh mục hành động chuyển đổi Tên sự kiện thẻ Google Mô tả
Bắt buộc Lượt mua hàng GIAO DỊCH MUA purchase Người dùng hoàn tất giao dịch mua
Rất nên dùng đối với tất cả trình tạo cửa hàng Thêm vào giỏ hàng ADD_TO_CART add_to_cart Người dùng thêm sản phẩm vào giỏ hàng
Rất nên dùng đối với tất cả trình tạo cửa hàng Bắt đầu quy trình thanh toán BEGIN_CHECKOUT begin_checkout Người dùng bắt đầu quy trình thanh toán
Rất nên dùng đối với tất cả trình tạo cửa hàng Xem mục PAGE_VIEW page_view Người dùng mở một trang sản phẩm
Bạn nên dùng khi có thể (thường không áp dụng cho trình tạo cửa hàng) Đăng ký ĐĂNG KÝ sign_up Người dùng đăng ký tài khoản
Bạn nên dùng khi có thể (thường không áp dụng cho trình tạo cửa hàng) Tạo khách hàng tiềm năng SUBMIT_LEAD_FORM generate_lead Người dùng tạo khách hàng tiềm năng thông qua một biểu mẫu
Bạn nên dùng khi có thể (thường không áp dụng cho trình tạo cửa hàng) Đăng ký SUBSCRIBE_PAID không áp dụng (tuỳ chỉnh) Người dùng đăng ký một dịch vụ có tính phí
Bạn nên dùng khi có thể (thường không áp dụng cho trình tạo cửa hàng) Đặt lịch hẹn BOOK_APPOINTMENT không áp dụng (tuỳ chỉnh) Người dùng đặt lịch hẹn
Bạn nên dùng khi có thể (thường không áp dụng cho trình tạo cửa hàng) Lượt yêu cầu thông tin báo giá REQUEST_QUOTE không áp dụng (tuỳ chỉnh) Người dùng gửi biểu mẫu yêu cầu báo giá

Người bán có sẵn tài khoản Google Ads

Nếu cho phép người bán tham gia bằng một tài khoản Google Ads hiện có, bạn có thể gặp phải trường hợp tài khoản đó đã có hành động chuyển đổi. Bạn không nên sử dụng hành động chuyển đổi hiện có vì không có gì đảm bảo rằng hành động đó đã được thiết lập đúng cách. Ngoài ra, bạn cần thực hiện thêm một số bước để xử lý các tình huống tiềm ẩn sau:

  • Tài khoản có nhiều mục tiêu (ví dụ: Giao dịch mua + Lượt xem trang + Số lượt liên hệ) đều được đánh dấu là "mục tiêu mặc định trong tài khoản". Khi được tạo, chiến dịch mới sẽ mặc định tối ưu hoá cho tất cả các mục tiêu này. Bạn không nên làm như vậy cho chiến dịch Tối đa hoá hiệu suất.

  • Tài khoản đã có một (hoặc nhiều) hành động chuyển đổi để theo dõi giao dịch mua và hành động chuyển đổi đó đã được nhóm trong mục tiêu Giao dịch mua. Điều này có nghĩa là sau khi bạn thực hiện, chiến dịch sẽ tính gấp đôi một giao dịch mua vì có hai thẻ chuyển đổi kích hoạt.

Để đảm bảo rằng chiến dịch Tối đa hoá hiệu suất chỉ sử dụng hành động chuyển đổi tuỳ chỉnh của bạn:

  1. Tạo một CustomConversionGoal (Mục tiêu lượt chuyển đổi tuỳ chỉnh) và thêm hành động chuyển đổi Giao dịch mua vào danh sách conversion_actions[] của mục tiêu. Đặt trạng thái thành BẬT.

  2. Trong ConversionGoalCampaignConfig của chiến dịch Tối đa hoá hiệu suất, hãy đặt custom_conversion_goal thành mục tiêu tuỳ chỉnh mà bạn đã tạo ở bước (1).

  3. Kết quả của bước (2) là Google Ads sẽ tự động cập nhật ConversionGoalCampaignConfig của chiến dịch để goal_config_level được đặt thành CAMPAIGN (thay vì CUSTOMER, mục tiêu này sẽ hướng đến việc sử dụng các mục tiêu mặc định của tài khoản), nhưng bạn nên kiểm tra kỹ để đảm bảo điều này thực sự đã xảy ra.

Truy xuất thẻ cho hành động chuyển đổi

Sau khi tạo hành động chuyển đổi, bạn cần chèn đoạn mã tương ứng (được gọi là thẻ) vào trang chuyển đổi trên trang web của nhà quảng cáo. Để đảm bảo Google Ads có thể đo lường tất cả lượt chuyển đổi bất kể trình duyệt của khách hàng, hãy sử dụng thẻ theo dõi lượt chuyển đổi mới của Google Ads. Thẻ này bao gồm hai phần:

  • global_site_tag, bạn phải cài đặt trên mọi trang của trang web của nhà quảng cáo.

  • event_snippet, bạn nên đặt trên các trang web cho biết một hành động chuyển đổi, chẳng hạn như trang xác nhận thanh toán hoặc trang gửi khách hàng tiềm năng.

Bạn có thể truy xuất hai phần này bằng ConversionActionService.

Thẻ này đặt cookie lưu trữ giá trị nhận dạng riêng biệt cho một khách hàng hoặc lượt nhấp vào quảng cáo đã đưa khách hàng đến trang web. Các cookie này nhận thông tin về lượt nhấp vào quảng cáo từ thông số Giá trị nhận dạng lượt nhấp của Google (GCLID) có trong thẻ theo dõi lượt chuyển đổi. Bạn phải bật trang web và hệ thống theo dõi khách hàng tiềm năng của nhà quảng cáo để ghi lại và lưu trữ GCLID. Đây là mã nhận dạng duy nhất mà Google Ads cung cấp cho mỗi lượt hiển thị quảng cáo của Google.

Tìm hiểu thêm về thẻ toàn trang web và vị trí cài đặt thẻ

Thẻ Google (gtag.js) là một API và khung gắn thẻ cho phép bạn gửi dữ liệu sự kiện đến cả Google Ads và Google Analytics. Thẻ toàn trang web hoạt động phối hợp với một đoạn mã sự kiện hoặc một đoạn mã điện thoại để theo dõi lượt chuyển đổi. Thêm thẻ Google vào mục <head> của mọi trang trên trang web của nhà quảng cáo và định cấu hình thẻ đó để hoạt động với Google Ads. Sau đó, bạn có thể sử dụng các lệnh gtag() để ghi lại sự kiện và gửi dữ liệu đến Google Ads. Để hiểu cách hoạt động của thẻ này, hãy xem bài viết Sử dụng thẻ toàn trang web cho tính năng theo dõi lượt chuyển đổi của Google Ads.

Bạn sử dụng các lệnh sau với thẻ Google:

  • config: Khởi chạy một sản phẩm của Google (Google Ads, Analytics, v.v.), định cấu hình chế độ cài đặt và chuẩn bị gửi dữ liệu đến một tài khoản.

  • sự kiện: Đăng ký lượt chuyển đổi bằng cách gửi một sự kiện như mua hàng (nên dùng) hoặc thêm vào giỏ hàng (hành động chuyển đổi phụ). Bạn nên xem lại Hướng dẫn tham khảo về sự kiện gtag.js.

  • set: Đặt các thông số chung cho tất cả sự kiện trên trang, chẳng hạn như đơn vị tiền tệ.

Ví dụ sau đây là một đoạn mã JavaScript của thẻ toàn trang web để gửi dữ liệu đến Google Ads. Giá trị phần giữ chỗ GOOGLE_CONVERSION_ID là một mã số duy nhất cho một tài khoản nhà quảng cáo.

<!-- 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>

Đoạn mã thẻ Google chỉ được xuất hiện một lần trên mỗi trang. Nếu đã có một bản sao gtag.js, bạn nên thêm mã thẻ mới vào thẻ hiện có. Để gửi dữ liệu đến nhiều tài khoản, bạn có thể thêm lệnh gọi vào lệnh "config" cho mọi tài khoản mà bạn đang sử dụng, chỉ định mã chuyển đổi của từng tài khoản, như trong ví dụ sau:

<!-- 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>

Thông tin khác về đoạn mã sự kiện và nơi cài đặt đoạn mã đó

Để tính năng theo dõi lượt chuyển đổi giao dịch mua hoạt động, bạn nên cài đặt đoạn mã sự kiện mua hàng trên chính trang chuyển đổi. Đây thường là trang xác nhận đơn đặt hàng. Bạn có thể đặt đoạn mã sự kiện ở mọi vị trí trong mã, sau đoạn mã thẻ toàn cầu. Bạn nên đặt đoạn mã sự kiện cho các hành động chuyển đổi phụ (ví dụ: thêm vào giỏ hàng) trong các trang tương ứng.

Trong đoạn mã mẫu dưới đây, AW-CONVERSION_IDgTag_developer_ID là mã chuyển đổi dành riêng cho tài khoản Google Ads và tài khoản nhà phát triển thẻ Google của bạn, còn AW-CONVERSION_LABEL là nhãn chuyển đổi dành riêng cho mỗi hành động chuyển đổi:

<!-- 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>

Mặc dù một số thông số là không bắt buộc, nhưng bạn nên đưa vào nhiều thông tin nhất có thể cho mỗi sự kiện. Tìm hiểu thêm về những thông số có sẵn cho từng loại sự kiện.

Thông số cung cấp thêm thông tin về cách người dùng tương tác với trang web hoặc ứng dụng của bạn.

Nếu muốn đo lường sự kiện chuyển đổi dựa trên một lượt nhấp (ví dụ: trên một nút hoặc phản hồi động cho trang web sử dụng AJAX), bạn cũng có thể sử dụng đoạn mã sau:

<!-- 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>

Thẻ Google có một API Chế độ đồng ý tích hợp để quản lý sự đồng ý của người dùng. Cookie này có thể phân biệt sự đồng ý của người dùng đối với cookie cho mục đích quảng cáo với sự đồng ý đối với cookie cho mục đích phân tích.

Kết quả dự kiến là khách hàng sẽ nhận được ít nhất lệnh gọi gtag('consent', 'update' {...}) được tích hợp mà khách hàng không cần làm gì cả. Điều này sẽ giúp đảm bảo rằng các thẻ Google (Google Ads, Floodlight, Google Analytics, Trình liên kết lượt chuyển đổi) có thể đọc trạng thái đồng ý mới nhất của người dùng và đưa trạng thái đó vào các yêu cầu mạng gửi đến Google (thông qua tham số &gcs).

Các bước triển khai bổ sung sẽ là triển khai hoặc hỗ trợ nhà quảng cáo triển khai (ví dụ: thông qua giao diện người dùng) trạng thái gtag('consent', default' {...}) và bỏ chặn thẻ Google (ví dụ: không kích hoạt có điều kiện dựa trên sự đồng ý) để cho phép chế độ đồng ý kích hoạt các thẻ đó theo cách nhận biết sự đồng ý.

Để biết thông tin chi tiết về cách triển khai, hãy xem bài viết Quản lý chế độ cài đặt về sự đồng ý (web).

Mẹo

Trong tài khoản người quản lý Google Ads,bạn có thể theo dõi lượt chuyển đổi trên tất cả tài khoản nhà quảng cáo bằng một thẻ mã chuyển đổi duy nhất. Xem bài viết giới thiệu về tính năng theo dõi lượt chuyển đổi trên nhiều tài khoản.

Cách tốt nhất để kiểm tra xem việc triển khai tính năng theo dõi lượt chuyển đổi có hoạt động hay không là truy cập vào một trong các trang web của người bán (hoặc trang web thử nghiệm nội bộ) và thực hiện giao dịch mua hàng thực tế. Sau đó, bạn có thể quan sát trong công cụ Hỗ trợ thẻ của Google để sử dụng hướng dẫn khắc phục sự cố này nhằm xác minh rằng Google Ads đã thấy thẻ của bạn và đang ghi lại lượt chuyển đổi thành công. Để biết thêm thông tin về cách khắc phục sự cố, hãy xem bài viết khắc phục sự cố về việc gắn thẻ trên toàn trang web.

Bạn có thể bổ sung tính năng lượt chuyển đổi nâng cao cho thẻ chuyển đổi trước đó. Điều này có thể giúp cải thiện độ chính xác của kết quả đo lường lượt chuyển đổi và giúp bạn đặt giá thầu hiệu quả hơn. Tìm hiểu thêm về cách thiết lập tính năng lượt chuyển đổi nâng cao. Trước khi triển khai tính năng lượt chuyển đổi nâng cao, bạn nên đảm bảo rằng người bán của mình có thể tuân thủ Chính sách về dữ liệu khách hàng của tính năng lượt chuyển đổi nâng cao trong Google Ads.