איך פועלת התכונה 'המרות משופרות לצורך שיוך ללידים'
כדי להשתמש בהמרות משופרות לצורך שיוך ללידים, צריך להגדיר תג ששולח GCLID ל-Google Ads באופן אוטומטי כשמשתמש שולח טופס להשארת פרטים. צריך להגדיר תיוג דרך Google Tag Manager או דרך Google Tag. כשהמשתמש שולח את הטופס לפרטי לידים, התג שולח ל-Google Ads את נתוני השליחה של נכסי השארת הפרטים, כמו כתובת האימייל של המשתמש, יחד עם GCLID. בהמשך כשהמשתמש יבצע המרה, תוכלו להעלות את ההמרה דרך ממשק המשתמש של Google Ads, כפי שמתואר במרכז העזרה, או להעלות את ההמרה עם פרטי הטופס להשארת פרטים דרך Google Ads API.
התכונה 'המרות משופרות לצורך שיוך ללידים' ב-Google Ads API מתעדת את שלב 5 בתהליך הבא.
יישום הדרישות המוקדמות
יש כמה דרישות מוקדמות להגדרה תקינה של המרות משופרות. ודאו שאתם עומדים בכל הדרישות המוקדמות לפני שתמשיכו בתהליך ההטמעה:
צריך להפעיל מעקב המרות בלקוח ההמרות של Google Ads.
מאשרים את התנאים בנוגע לנתוני לקוחות ומביעים הסכמה לשימוש בהמרות משופרות לצורך שיוך ללידים.
הגדרת התיוג.
1. הפעלת מעקב המרות בלקוח ההמרות של Google Ads
אחזור מידע על ההגדרה של מעקב ההמרות
כדי לבדוק את ההגדרה של מעקב ההמרות בחשבון ולוודא שמעקב ההמרות מופעל, שולחים שאילתה למשאב Customer
של ConversionTrackingSetting
.
יוצרים את השאילתה הבאה עם GoogleAdsService.SearchStream
:
SELECT
customer.conversion_tracking_setting.google_ads_conversion_customer,
customer.conversion_tracking_setting.conversion_tracking_status,
customer.conversion_tracking_setting.conversion_tracking_id,
customer.conversion_tracking_setting.cross_account_conversion_tracking_id
FROM customer
השדה google_ads_conversion_customer
מציין את חשבון Google Ads שיוצר ומנהל את ההמרות עבור הלקוח הזה. ללקוחות שמשתמשים במעקב המרות ברמת חשבון ניהול, זהו המזהה של חשבון הניהול. כדי ליצור ולנהל המרות, צריך להזין את מספר הלקוח של ההמרה ב-Google Ads בתור customer_id
בבקשות של Google Ads API.
שימו לב שהשדה הזה מאוכלס גם אם מעקב ההמרות לא מופעל.
השדה conversion_tracking_status
מציין אם מעקב המרות מופעל ואם בחשבון נעשה שימוש במעקב המרות ברמת חשבון ניהול.
יצירה של פעולת המרה בחשבון ההמרה של Google Ads
אם הערך conversion_tracking_status
הוא NOT_CONVERSION_TRACKED
, לא הופעל בחשבון מעקב המרות. הפעילו מעקב המרות על ידי יצירת ConversionAction
אחד לפחות בחשבון ההמרות ב-Google Ads, כמו בדוגמה הבאה. לחלופין, ניתן לך ליצור פעולת המרה בממשק המשתמש על ידי ביצוע ההוראות במרכז העזרה של סוג ההמרה שרוצים להפעיל.
שימו לב שהמרות משופרות מופעלות באופן אוטומטי כשהן נשלחות דרך Google Ads API, אבל אפשר להשבית אותן דרך ממשק המשתמש של Google Ads.
קוד לדוגמה
Java
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#
public void Run(GoogleAdsClient client, long customerId) { // Get the ConversionActionService. ConversionActionServiceClient conversionActionService = client.GetService(Services.V16.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
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 ); } }
Python
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}".' )
Ruby
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
Perl
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::V16::Resources::ConversionAction->new({ name => $conversion_action_name, category => DEFAULT, type => WEBPAGE, status => ENABLED, viewThroughLookbackWindowDays => 15, valueSettings => Google::Ads::GoogleAds::V16::Resources::ValueSettings->new({ defaultValue => 23.41, alwaysUseDefaultValue => "true" })}); # Create a conversion action operation. my $conversion_action_operation = Google::Ads::GoogleAds::V16::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; }
מוודאים שהשדה conversion_action_type
מוגדר לערך הנכון של ConversionActionType
.
לקבלת הדרכה נוספת לגבי יצירת פעולות המרה ב-Google Ads API, אפשר לעיין במאמר יצירת פעולות המרה.
אחזור של פעולת המרה קיימת
אפשר לאחזר פרטים על פעולת המרה קיימת על ידי
הרצת השאילתה הבאה. ודאו שמספר הלקוח בבקשה מוגדר ללקוח ההמרה ב-Google Ads שציינתם למעלה, ושסוג פעולת ההמרה מוגדר לערך הנכון של ConversionActionType
.
SELECT
conversion_action.resource_name,
conversion_action.name,
conversion_action.status
FROM conversion_action
WHERE conversion_action.type = 'UPLOAD_CLICKS'
2. אישור התנאים בנוגע לנתוני לקוחות והבעת הסכמה לשימוש בהמרות משופרות לצורך שיוך ללידים
כדי להשתמש בהמרות משופרות לצורך שיוך ללידים, עליכם להביע הסכמה לשימוש בהמרות משופרות לצורך שיוך ללידים ולאשר את התנאים בנוגע לנתונים של לקוחות. כדי לבדוק אם הדרישות המוקדמות האלה כבר מתקיימים, שולחים את השאילתה הבאה ללקוח ההמרה של Google Ads:
SELECT
customer.id,
customer.conversion_tracking_setting.accepted_customer_data_terms,
customer.conversion_tracking_setting.enhanced_conversions_for_leads_enabled
FROM customer
אם הערך של accepted_customer_data_terms
או של enhanced_conversions_for_leads_enabled
הוא false
, עליכם לפעול לפי ההוראות במרכז העזרה כדי לעמוד בדרישות המוקדמות האלה.
3. הגדרת התיוג
אפשר להגדיר את Google Tag כך שיופעל המרות משופרות לצורך שיוך ללידים. לשם כך, פועלים לפי ההוראות במרכז העזרה. כדי להגדיר המרות משופרות לצורך שיוך ללידים באמצעות Google Tag Manager, צריך לפעול לפי instructions.
השלבים הבאים
כשתעמדו בדרישות המוקדמות, תוכלו להטמיע המרות משופרות לצורך שיוך ללידים.