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

create dmp userlist

1.下載sdk https://developers.google.com/doubleclick-data/docs/clientlibraries
2.解壓縮並放到根目錄
3.把ads.properties放到根目錄
4.到ddp的目錄執行 mvn install  -DskipTests
5.到 examples/ddp_appengine/ 執行 mvn install
6.執行程式 mvn -X exec:java -Dexec.mainClass="ddp.jaxws.v201705.AddDmpUserList"
7.執行程式 mvn -X exec:java -Dexec.mainClass="ddp.jaxws.v201705.GetAllDmpUserLists"