Google Custom Search

2018/01/03

upload data to dmp

upload data to dmp

要上傳資料到dmp,必須將資料用protobuf包裝,內容是google id, user list id
https://developers.google.com/protocol-buffers/

google已經幫我們把格式包好
https://developers.google.com/ad-exchange/rtb/downloads/cookie-bulk-upload-proto

只需要將它放到目標路徑中執行即可

為了方便管理,我把它放在上次sdk的目錄

ddp-api-client-library/protobuf

這裡的protobuf就是從 https://developers.google.com/protocol-buffers/ 下載的

然後把 cookie-bulk-upload-proto.proto (從https://developers.google.com/ad-exchange/rtb/downloads/cookie-bulk-upload-proto下載) 放到 ddp-api-client-library/protobuf/examples

設定classpath

export CLASSPATH=/你的路徑/ddp-api-client-library/protobuf/java/core/target/classes

編輯mytest.java, 這檔案就是把google id, userlist id 包裝成protobuf

然後修改makefile檔 ddp-api-client-library/protobuf/examples/Makefile

然後make clean, make java

curl --insecure --request POST --data-binary "@上傳cookie的檔名" https://cm.g.doubleclick.net/upload?nid=dmp nid name

沒有留言 :