Filter
Exclude
Time range
-
Near
Yahoo!ディスプレイ広告の配信データをAPI使ってスプシに落とそうと頑張ったけど無理だった... というかテストアカウントでは成功したけど、恐らく権限の問題で本番アカウントの呼び出しが出来ず。 どうやら先方の権限で許可してもらう必要がありそう。 この3時間の格闘の結果を半ギレのClaude氏にまとめてもらったので、Yahoo!広告の自動取得にトライされる方の参考になれば...グフッ ↓ 【以下Claude氏執筆】 Yahoo!ディスプレイ広告のAPIをGASで叩いてスプシにレポート出力しようとしたら、最後の最後でハマった話。 結論から言うと 「MCCアカウントでWeb管理画面からアクセスできる ≠ API経由でもアクセスできる」 ということが判明。ここ、ドキュメントにほぼ書いてない。 まず前提として、今のYahoo!広告APIは「LINEヤフー広告 API」に統合されてて、申し込みフローがこう ①Yahoo!デベロッパーでアプリ作成 ②LINEヤフー広告API利用申し込み ③API管理ツールで設定 ④OAuth2認証 ⑤APIコール ここまではまぁ普通なんだけど、ハマりポイントが3つあった。 【ハマり1】APIドメインが変わってる ネットに転がってる情報は旧ドメインばかりで、DNS errorが出て「は?」ってなる。APIバージョンもv19まで上がってて、v14の情報で書いても動かない。 【ハマり2】v19でリクエスト構造が変わってる accountIdをリクエストボディじゃなくてHTTPヘッダー(x-z-base-account-id)で渡す方式に変わってた。あとレポート作成時のフィールド名も地味に変わってて、format → reportDownloadFormat、encode → reportDownloadEncode みたいな感じ。 reportTypeConditionっていうネストされたオブジェクトの中にreportTypeを入れる...と思いきや、ADレポートの場合はそもそも省略が正解、とか。 公式リファレンスのYAMLスキーマまで掘らないとわからなかった。 【ハマり3】MCC権限とAPI権限が別管理 テストアカウントでは完璧に動いた。レポート作成→ポーリング→CSVダウンロード→スプシ書き込み、全部OK。 で、意気揚々と本番アカウントのIDに切り替えたら 401「Account not found」。 BaseAccountService/getを叩いてアクセス可能なアカウント一覧を取得したら、MCCアカウント(自分)しか出てこない。 Web管理画面ではMCC経由でクライアントのアカウントに普通にアクセスできてるのに、API側からは見えない。 公式ドキュメントを漁ったら、こんな一文を発見 「追加したい広告アカウントの権限を持つビジネスIDで認可認証をしてください」 つまり、クライアント側のビジネスIDでAPIアプリへのアクセス承認をしてもらう必要があるっぽい。 MCCの管理権限だけじゃダメで、APIアクセスは別枠で許可が必要。 これ、代理店あるあるの運用フローだと思うんだけど、ドキュメントにほぼ書いてない。 API管理ツールの画面にもアカウント紐づけのUIが見当たらない。 GASスクリプト自体は完成してて、8セグメント(広告グループ/都道府県/広告/見出し/説明文/配信先/性別/年齢)をそれぞれ別シートに出力する仕組み。 権限さえ通れば即稼働できる状態。 ぶっちゃけ、ここまでの試行錯誤で3時間ぐらい溶かした。 API自体の仕様よりも、権限周りの情報が圧倒的に足りてない。 Yahoo!のAPI使おうとしてる人、同じところでハマると思うので参考になれば。
14
2,677
They don’t fix stuff when you report it to them. sellercentral.amazon.com/cu/… “Complete listings report reportType: GET_MERCHANT_LISTINGS_DATA” Should read “All listings report reportType: GET_MERCHANT_LISTINGS_ALL_DATA” reported 4 days ago. How long does it take to change two words? What’s the odds of them ever fixing it? This mess is confusing enough without being wrong! The documentation is poor, their data dictionary standards are lax and feature improvements to meet developments elsewhere are non-existent.
2
44
If you're ever given the unenviable task of reviewing all group policies for one of your Active Directory domains, you can generate a full report like this: get-gporeport -All -ReportType HTML -Path all_group_policies.html
4
26
203
13,426
26 Aug 2024
【Yahoo広告運用をする方必見】(マニアックな投稿です ^^) 以外に知られていないのでシェア。Yahoo広告運用しているとDailyの運用状況気になりませんか?都度管理画面を見に行くのもいいのですが、圧倒的に「Yahoo!広告 スクリプト」が便利です。ビジネスマネージャーとGoogleアカウントを紐づけさえすれば、GASに毎日パフォーマンスデータを出力できます。GASに入っちゃえすればこっちのもの。Slackに毎日吐き出すなど自由自在!こんな簡単なコードを張り付ければいけちゃいます。ぜひ「Yahoo!広告 スクリプト」をこの機会に!以下サンプルコード、@は変数です function main(){ const spreadsheetId = '@'; const ss = SpreadsheetApp.openById(spreadsheetId); let sh = ss.getSheetByName('@'); var dt = new Date(); dt.setMonth(dt.getMonth()-50); const startDate = Utilities.formatDate(dt, 'Asia/Tokyo', 'yyyyMMdd'); const endDate = Utilities.formatDate(new Date(), 'Asia/Tokyo', 'yyyyMMdd'); const reports = AdsUtilities.getSearchReport({ accountId: AdsUtilities.getCurrentAccountId(), dateRange: { endDate: endDate, startDate: startDate, }, fields: ['DAY','CAMPAIGN_NAME','ADGROUP_NAME','IMPS','CLICKS','COST','CLICK_RATE','CONVERSIONS','CONV_VALUE','AVG_CPC','CONV_VALUE_PER_COST'], reportDateRangeType:"CUSTOM_DATE", reportType: 'ADGROUP', reportSkipColumnHeader : 'FALSE', }); sh.getRange('A2').setValues(reports.reports[0].rows); }
15
521
Replying to @markfsa
Hi there, thanks for looping us in. Here is a link where you can find information about ISO27001 certificates: goo.gle/3V9h5KK\#/ReportType=Certificate. For further assistance, you can reach out to our support team here: goo.gle/3yAby7i Hope this helps. -SI
18
19 Apr 2024
To load the CSV files into PostgreSQL, step 1: Store this SQL as a file named 001.001.001.create_schema_and_basetables.sql: DROP SCHEMA <schema> CASCADE; CREATE SCHEMA <schema>; SET SEARCH_PATH TO <schema>; CREATE TABLE sta_icsr ( elocnr character varying, reporttype character varying, evgatewayrecdate character varying, primarysourcequalification character varying, primarysourcecountryforregulatorypurposes character varying, literaturereference character varying, patientagegroup character varying, patientagegroupperreporter character varying, parentchildreport character varying, patientsex character varying, reactionlist character varying, suspectdruglist character varying, concomitant character varying ); CREATE TABLE dwh_elocnrs ( id serial, elocnr character varying, evdate date ); CREATE INDEX ix_eloc_id on dwh_elocnrs using btree(id); CREATE INDEX ix_eloc_elocnr on dwh_elocnrs using btree(elocnr); CREATE TABLE dwh_primarysourcequalifications ( id serial, primarysourcequalification character varying ); CREATE INDEX ix_psq_id on dwh_primarysourcequalifications using btree(id); CREATE INDEX ix_psq_primarysourcequalification on dwh_primarysourcequalifications using btree(primarysourcequalification); CREATE TABLE dwh_primarysourcecountryforregulatorypurposes ( id serial, primarysourcecountryforregulatorypurposes character varying ); CREATE TABLE dwh_literaturereferences ( id serial, literaturereference character varying ); CREATE TABLE dwh_patientagegroup ( id serial, patientagegroup character varying ); CREATE TABLE dwh_patientagegroupperreporter ( id serial, patientagegroupperreporter character varying ); CREATE TABLE dwh_parentchildreport ( id serial, parentchildreport character varying ); CREATE TABLE dwh_patientsex ( id serial, patientsex character varying ); CREATE TABLE dwh_reactionlists ( id serial, reactionlist character varying ); CREATE INDEX ix_reactionlist_id on dwh_reactionlists using btree(id); CREATE INDEX ix_reactionlist_reactionlist on dwh_reactionlists using btree(reactionlist); CREATE TABLE dwh_reaction_outcomes ( id serial, outcome character varying ); INSERT INTO dwh_reaction_outcomes(id, outcome) values (0, 'Unidentified Outcome'); CREATE INDEX ix_reaction_outcomes_id on dwh_reaction_outcomes using btree(id); CREATE INDEX ix_reaction_outcomes_outcome on dwh_reaction_outcomes using btree(outcome); CREATE TABLE dwh_reaction_seriousness ( id serial, seriousness character varying ); INSERT INTO dwh_reaction_seriousness(id, seriousness) values (0, 'Unidentified Seriousness'); CREATE INDEX ix_reaction_seriousness_id on dwh_reaction_outcomes using btree(id); CREATE INDEX ix_reaction_seriousness_seriousness on dwh_reaction_seriousness using btree(seriousness); CREATE VIEW <schema>.v_reactiondetails as ( SELECT elocnr, TRIM(BOTH FROM regexp_replace(split_part(regexp_split_to_table(reactionlist, '<BR><BR>'), ' (', 1), '"', '')) AS llt, split_part(split_part(regexp_split_to_table(reactionlist, '<BR><BR>'), ' (', 2), ' - ', 1) AS duration, split_part(split_part(regexp_split_to_table(reactionlist, '<BR><BR>'), ' (', 2), ' - ', 2) AS outcome, regexp_replace(split_part(split_part(regexp_split_to_table(reactionlist, '<BR><BR>'), ' (', 2), ' - ', 3), '[\)\"\,] $', '') AS seriousness FROM <schema>.sta_icsr ); CREATE TABLE dwh_suspectdruglists ( id serial, suspectdruglist character varying ); CREATE VIEW <schema>.v_drugdetails AS SELECT elocnr, split_part(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), '] (', 2), ' - ', 1) AS drugrole, regexp_split_to_table(split_part(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), '] (', 2), ' - ', 2), ', ') AS drugindication, split_part(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), '] (', 2), ' - ', 3) AS drugaction, split_part(regexp_replace(regexp_replace(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), ' - [', 2), ' - More in ICSR', ''), '[\]\)\,\""] $', ''), ' - ', 1) AS drugduration, split_part(regexp_replace(regexp_replace(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), ' - [', 2), ' - More in ICSR', ''), '[\]\)\,\""] $', ''), ' - ', 2) AS drugdose, split_part(regexp_replace(regexp_replace(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), ' - [', 2), ' - More in ICSR', ''), '[\]\)\,\""] $', ''), ' - ', 3) AS drugroute, TRIM(BOTH FROM regexp_replace(split_part(split_part(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), '] (', 1), '\[', 1), '[', 1), '\"', '')) AS drug1, split_part(split_part(split_part(regexp_split_to_table(suspectdruglist, '<BR><BR>'), '] (', 1), '\[', 1), '[', 2) AS drug2 FROM sta_icsr ;
2
10
29
2,467
21 Feb 2023
Replying to @heystanislav
Not wrong, but room for improvement. - I'd create an enum holding the file types: HTML, PDF, XLS. -ReportType type would be this enum instead of string. -Encapsulate: ReportType is private and set via constructor at the moment of instantiation -Switch instead of if's
5
591
21 Feb 2023
Replying to @heystanislav
ReportType should be an interface of type (let's say, IReportType) which has various concrete implementations of the various types of reports. The "ReportGeneration" class should not have concrete information about the type of report it wishes to generate.
1
3
624
13 Feb 2023
而关于这个reporttype在google上查询只有78个页面,github上也只有61个hit。这个做的相当提高效率了。。我觉得很多公司后面都会提供这个subscription。节省了很多时间。但是硬币的另一面是,快是快了,如果有安全问题,可能会一倒倒一片,毕竟开发者没有认真研究api调用的细节。。。。n/n
3
2
34
17,974
11 Nov 2021
Thursday Tip💡 Analysing GPO's with Group Policy Analytics? Get them exported fast with this snippet:- Get-GPO -All | ForEach-Object { Get-GPOReport -Guid $_.Id -ReportType XML -Path C:\temp\$($_.DisplayName).xml } docs.microsoft.com/en-us/mem… #MEMPowered #GroupPolicyAnalytics
3
30
86
まず前回の内容の訂正とか補足から。 key-export-toolが生成するキーファイル。ReportTypeが見当たらないからv1.5未満にしか対応していないかと思っていたら、Protocol Bufferの定義にはきちんとReportTypeがありました。 このツール経由で書き込まれている形跡がない…? github.com/google/exposure-n…

1
1
12 Sep 2020
OMG finally it's here. One of my key points in cheatsheets for creating new fields was - Ask business which report's u need field in to enable on reporttype. @nagpal6_sakshi just mentioned an update -"Auto-Add field to Report Type" i am crying #SheforceWIT #TrailblazingTogether
1
2
28 Apr 2017
nberのwpとか皆どうやってbibtexにしてるんですかね?reportタイプにしてreporttypeにNBER working paperって入れてるんですか?zoteroでは出来るけどpapersでは出来ないんですけど。
@iambak http://www.intelius.com/results.php?ReportType=33& its some1s cellphone in Deland, FL. Theyre using tht area code as a coy