{"id":1656,"date":"2021-02-02T19:04:28","date_gmt":"2021-02-02T19:04:28","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=1656"},"modified":"2021-02-02T19:04:28","modified_gmt":"2021-02-02T19:04:28","slug":"google-ads-script-%d0%b2%d1%8b%d0%b3%d1%80%d1%83%d0%b7%d0%ba%d0%b0-%d0%bd%d0%b8%d0%b7%d0%ba%d0%be%d1%87%d0%b0%d1%81%d1%82%d0%be%d1%82%d0%bd%d1%8b%d1%85-%d0%bf%d0%be%d0%b8%d1%81%d0%ba%d0%be%d0%b2","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=1656","title":{"rendered":"Google Ads Script: \u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0438\u0437\u043a\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 Google Ads"},"content":{"rendered":"\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0438\u0437 Google Ads \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0438\u0437\u043a\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445, \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0438 \u043c\u0438\u043d\u0443\u0441-\u0441\u043b\u043e\u0432. \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 Google Analytics.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u2013&nbsp;<a href=\"https:\/\/www.ppchero.com\/how-to-find-missing-search-terms-for-google-ads\/\">How to Find Missing Search Terms for Google Ads.<\/a><br>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f1. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439&nbsp;<a href=\"http:\/\/sheet.new\/\">Google Sheet<\/a>&nbsp;\u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e URL \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e&nbsp;<em>ss<\/em>.<\/p>\n\n\n\n<p>2. \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435&nbsp;<em>Analytics<\/em>&nbsp;\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 API Google Ads \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n\n\n\n<p>3. \u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439&nbsp;<em>viewId<\/em>&nbsp;\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f Google Analytics. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438&nbsp;<a href=\"https:\/\/ga-dev-tools.appspot.com\/query-explorer\/\">Query Explorer.<br><\/a><br>4. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0434\u0430\u0442\u044b \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<br>\u0424\u043e\u0440\u043c\u0430\u0442:&nbsp;<em>yyyy-mm-dd<\/em><\/p>\n\n\n\n<p>5. \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0439\u0442\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442.<br>https:\/\/www.patreon.com\/platform\/iframe?widget=become-patron-button&amp;redirectURI=https%3A%2F%2Fchiliad.agency%2Fmissing-search-terms%3Ffbclid%3DIwAR3y7WZzVGUhfZ7fAGi7NW2eYEuah6Ib_UiR-3F77MWXL9VjBDB0T0Ayp-I&amp;creatorID=43027345\u041a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/************************************************************\n* Hidden Search Term Report\n*\n* Version 1.0 \n* Date 01.01.2020\n*\n* Created by: Dmytro Tonkikh\n*\n* Telegram channel - https:\/\/t.me\/adwordsscripts\n*\n* For donates:\n* - Patreon - https:\/\/www.patreon.com\/bePatron?u=43027345\n* - Monobank (Visa\/MasterCard): https:\/\/send.monobank.com.ua\/2r4Vye2xV\n*************************************************************\/\n\n\/\/ Insert your SPREADSHEET_URL - create easily with https:\/\/sheet.new\nvar ss = SpreadsheetApp.openByUrl(\"https:\/\/docs.google.com\/spreadsheets\/d\/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\/edit#gid=0\");\n\/\/Google Ananlytics View ID - use https:\/\/ga-dev-tools.appspot.com\/query-explorer\/ to find view id\nvar viewId = 'ga:xxxxxxxx';\n\/\/ Dates should be in yyyy-mm-dd format.\nvar startDate = '2020-12-01';\nvar endDate = '2020-12-31';\n\nfunction main() {\n    setupSpreadsheet();\n    getAnalyticsStats();\n    getGoogleAdsStats();\n}\n\nfunction getGoogleAdsStats() {\n    var sheet = ss.getSheetByName('googleads');\n    var REPORTING_OPTIONS = {\n        apiVersion: 'v201809',\n        includeZeroImpressions: true\n    };\n\n    var report = AdsApp.report('SELECT Query, Clicks, CampaignId, AdGroupId FROM SEARCH_QUERY_PERFORMANCE_REPORT DURING ' + &#91;startDate.replace(\/-\/g, ''), endDate.replace(\/-\/g, '')].join(','), REPORTING_OPTIONS);\n\n    sheet.clear();\n    report.exportToSheet(sheet);\n}\n\nfunction getAnalyticsStats() {\n\n    var retval = &#91;];\n    var options = {\n        'dimensions': 'ga:adGroup,ga:adMatchedQuery,ga:adwordsCampaignID',\n        'include-empty-rows': false,\n        'filters': 'ga:users>=0;ga:adMatchedQuery!=(not set)',\n        'start-index': 1,\n        'max-results': 10000\n    }\n\n    var metrics = 'ga:users,ga:adClicks, ga:transactions';\n    var headers;\n    do {\n        var results = Analytics.Data.Ga.get(viewId, startDate, endDate, metrics, options);\n        var queryR = results.query;\n        if (!headers) {\n            headers = results.columnHeaders.map(function(h) { return h.name.replace('ga:', '') });\n            retval.push(headers)\n            Logger.log(headers);\n        }\n\n        retval = retval.concat(results.rows);\n        options&#91;'start-index'] += results.rows.length\n\n    } while (results.nextLink)\n\n    var sheet = ss.getSheetByName(\"analytics\");\n    sheet.clear();\n\n    sheet.getRange(1, 1, retval.length, retval&#91;0].length).setValues(retval);\n}\n\nfunction setupSpreadsheet() {\n    var sheets = &#91;'analytics', 'googleads'];\n    sheets.forEach(function(s) {\n        if (!ss.getSheetByName(s)) {\n            ss.insertSheet(s)\n        }\n    })\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0438\u0437 Google Ads \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0438\u0437\u043a\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445, \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0438 \u043c\u0438\u043d\u0443\u0441-\u0441\u043b\u043e\u0432. \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 Google Analytics.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[106],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1656"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1656"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1656\/revisions"}],"predecessor-version":[{"id":1657,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1656\/revisions\/1657"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}