How to duplicate a campaign using Google Ads API?
I'm looking for a way to "copy & paste" functionality (the UI has it) of the entire campaign in Google Ads.
There is any way to do it using Google Ads API?
Tony-Marketing-API.cn is a vibrant community dedicated to Facebook, Meta,Google Ads api, app development, Instagram, and related technologies. It offers valuable bug solutions, troubleshooting cases, and problem-solving strategies shared by users. Stay updated with real-world solutions, development tips, and the latest trends in digital marketing and app development.
I'm looking for a way to "copy & paste" functionality (the UI has it) of the entire campaign in Google Ads.
There is any way to do it using Google Ads API?
In podfile.lock I have:
- Google-Mobile-Ads-SDK (8.7.0):
- GoogleAppMeasurement (< 9.0, >= 7.0)
- GoogleUserMessagingPlatform (>= 1.1)
This code works fine, so the SDK installed successfully.
import GoogleMobileAds let options = GADMultipleAdsAdLoaderOptions() options.numberOfAds = 5 adLoader = GADAdLoader(adUnitID: adUnitID, rootViewController: requester, adTypes: [.native], options: [options]) adLoader.delegate = self
But I can display the received GADNativeAd, because views are unaccessible.
import UIKit import GoogleMobileAds class FeedAdTVC: UITableViewCell { func setup(with: GADNativeAd) { let templateView = GADUnifiedNativeAdView() } }
I got: Cannot find 'GADUnifiedNativeAdView' in scope
I've been trying to run some sample code from the official docs.
But I get an error: Invalid reporting query: ACCOUNT_PERFORMANCE_REPORT. (file Code.gs, line 18)
The official sample from the official doc: https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_report
My code:
function main() { var spreadsheet = SpreadsheetApp.create("Report output"); //var report = AdsApp.report("SELECT Id, PolicySummary FROM ACCOUNT_PERFORMANCE_REPORT DURING LAST_30_DAYS"); var report = AdsApp.report("SELECT Clicks, Impressions, AverageCpc, HourOfDay FROM ACCOUNT_PERFORMANCE_REPORT DURING LAST_MONTH"); report.exportToSheet(spreadsheet.getActiveSheet()); Logger.log("Report available at " + spreadsheet.getUrl()); }
I am trying to extract the Unnest data contained in JSON Arrays that Google Ads sends via BigQuery Data Transfers. Unfortunately, I am getting stuck in the middle.
Original Data in a BigQuery Table:
CreativeId | ResponsiveSearchAdDescriptions |
---|---|
487067671679 | [{"assetText":"SearchAds Description Text 1","assetId":12443453594,"pinnedField":"DESCRIPTION_1","assetPerformanceLabel":"PENDING","assetApprovalStatus":"APPROVED"},{"assetText":"SearchAds Description Text 2","assetId":12443453165,"assetPerformanceLabel":"PENDING","assetApprovalStatus":"APPROVED"},{"assetText":"SearchAds Description Text 3","assetId":12443453168,"assetPerformanceLabel":"PENDING","assetApprovalStatus":"APPROVED"},{"assetText":"SearchAds Description Text 4","assetId":12443419160,"assetPerformanceLabel":"PENDING","assetApprovalStatus":"APPROVED"}] |
Desired Outcome:
CreativeId | ResponsiveSearchAdDescriptions_assetText | ResponsiveSearchAdDescriptions_assetId | ResponsiveSearchAdDescriptions_pinnedField | ResponsiveSearchAdDescriptions_assetPerformanceLabel | ResponsiveSearchAdDescriptions_assetApprovalStatus |
---|---|---|---|---|---|
487067671679 | SearchAds Description Text 1 | 12443453594 | DESCRIPTION_1 | PENDING | APPROVED |
487067671679 | SearchAds Description Text 2 | 12443453165 | --- | PENDING | APPROVED |
487067671679 | SearchAds Description Text 3 | 12443453168 | --- | PENDING | APPROVED |
487067671679 | SearchAds Description Text 4 | 12443419160 | --- | PENDING | APPROVED |
This is the query that got me the closest but is still showing JSON.
SELECT CreativeId, JSON_QUERY_ARRAY(ResponsiveSearchAdDescriptions) AS Ads FROM `priXXXXXX.sandbox.Ad_XXXXXXX` WHERE ResponsiveSearchAdDescriptions IS NOT NULL LIMIT 100
The Query should be able to include this condition ResponsiveSearchAdDescriptions IS NOT NULL
Some ideas?
I try to run the following ad-words from my adwords script editor.
My final goal is to be able to run query1 or query2
//conversion_action var query1 = "SELECT conversion_action.app_id, conversion_action.attribution_model_settings.attribution_model, conversion_action.attribution_model_settings.data_driven_model_status, conversion_action.category, conversion_action.click_through_lookback_window_days, conversion_action.counting_type, conversion_action.firebase_settings.event_name, conversion_action.firebase_settings.project_id, conversion_action.id, conversion_action.include_in_conversions_metric, conversion_action.name, conversion_action.owner_customer, conversion_action.resource_name, conversion_action.status, conversion_action.tag_snippets, conversion_action.third_party_app_analytics_settings.event_name, conversion_action.third_party_app_analytics_settings.provider_name, conversion_action.type, conversion_action.value_settings.always_use_default_value, conversion_action.value_settings.default_currency_code, conversion_action.value_settings.default_value, conversion_action.view_through_lookback_window_days, metrics.conversion_last_conversion_date FROM conversion_action WHERE metrics.conversion_last_conversion_date > '2020-01-01'"; var TimeFrame = spreadsheet.getRangeByName("Last_x_days").getValue(); var now = new Date(); var from = new Date(now.getTime() - 10 * MILLIS_PER_DAY); var query2 = "SELECT conversion_action.firebase_settings.event_name, conversion_action.type, conversion_action.name,conversion_action.resource_name, conversion_action.third_party_app_analytics_settings.event_name, metrics.conversion_last_conversion_date FROM conversion_action WHERE metrics.conversion_last_conversion_date > '" + Utilities.formatDate(from, AdsApp.currentAccount().getTimeZone(), 'yyyy-MM-dd') + "'"; var report = AdWordsApp.report(query2, { apiVersion: 'v8' });
But I get a vague error:
We're sorry, a server error occurred. Please wait a bit and try again. (file code.gs, line 25)
which is the last code line here
What can it be?