[关闭]
@JunQiu 2018-09-18T18:04:26.000000Z 字数 5130 阅读 1159

facebookAd_Api、curl、mongo_explain

other linux summary_2018/06 mongodb


1、日常工作


2、技术学习

  1. curl -X POST \
  2. -F 'name=My campaign' \ //名字
  3. -F 'objective=LINK_CLICKS' \ //广告目标:点击链接
  4. -F 'status=PAUSED' \ //广告状态
  5. -F 'access_token=<ACCESS_TOKEN>' \ //ACCESS_TOKEN
  6. https://graph.facebook.com/v3.0/act_<AD_ACCOUNT_ID>/campaigns
  7. //AD_ACCOUNT_ID:facebook account id
  8. 返回广告系列id:{ id: '120330000029077009' }
  1. curl \
  2. -F 'name=My Ad Set' \
  3. -F 'optimization_goal=REACH' \
  4. -F 'billing_event=IMPRESSIONS' \
  5. -F 'bid_amount=2' \
  6. -F 'daily_budget=1000' \
  7. -F 'campaign_id=120330000029077009' \
  8. -F 'targeting={"geo_locations":{"countries":["US"]}}' \
  9. -F 'status=PAUSED' \
  10. -F 'promoted_object={"page_id":""}' \
  11. -F 'access_token=' \ //ACCESS_TOKEN
  12. https://graph.facebook.com/v3.0/act_<AD_ACCOUNT_ID>/adsets
  13. 返回值:
  14. 返回广告组ID:{"id":"120330000029078409"}
  1. curl \
  2. -F "name=ad" \
  3. -F 'status=ACTIVE' \
  4. -F "adset_id=" \
  5. -F "creative={'name': 'test-creative','body': 'test','image_hash': '','object_type': 'PAGE','object_id': ''}" \
  6. -F "object_url=" \
  7. -F "access_token=" \
  8. "https://graph.facebook.com/v3.0/act_<AD_ACCOUNT_ID>/ads"
  9. 返回值广告ID:{"id":"120330000029078809"}
  1. curl -G \
  2. -d "date_preset=today" \
  3. -d "access_token=" \
  4. "https://graph.facebook.com/v3.0/120330000029077009/insights"
  5. 返回值:
  6. {"data":[{"date_start":"2018-06-20","date_stop":"2018-06-20","impressions":"100","spend":"10","account_id":"101671007239408","campaign_id":"120330000029077009"}],"paging":{"cursors":{"before":"MAZDZD","after":"MAZDZD"}}}


  1. db.getCollection("student").explain('allPlansExecution').find({id:'0101111'})
  2. {
  3. "queryPlanner" : {
  4. "plannerVersion" : 1,
  5. "namespace" : "test.student",
  6. "indexFilterSet" : false,
  7. "parsedQuery" : {
  8. "id" : {
  9. "$eq" : "0101111"
  10. }
  11. },
  12. "winningPlan" : {
  13. "stage" : "FETCH",
  14. "inputStage" : {
  15. "stage" : "IXSCAN",
  16. "keyPattern" : {
  17. "id" : 1
  18. },
  19. "indexName" : "id_1",
  20. "isMultiKey" : false,
  21. "multiKeyPaths" : {
  22. "id" : [ ]
  23. },
  24. "isUnique" : true,
  25. "isSparse" : false,
  26. "isPartial" : false,
  27. "indexVersion" : 2,
  28. "direction" : "forward",
  29. "indexBounds" : {
  30. "id" : [
  31. "[\"0101111\", \"0101111\"]"
  32. ]
  33. }
  34. }
  35. },
  36. "rejectedPlans" : [ ]
  37. },
  38. "executionStats" : {
  39. "executionSuccess" : true,
  40. "nReturned" : 1,
  41. "executionTimeMillis" : 78,
  42. "totalKeysExamined" : 1,
  43. "totalDocsExamined" : 1,
  44. "executionStages" : {
  45. "stage" : "FETCH",
  46. "nReturned" : 1,
  47. "executionTimeMillisEstimate" : 0,
  48. "works" : 2,
  49. "advanced" : 1,
  50. "needTime" : 0,
  51. "needYield" : 0,
  52. "saveState" : 0,
  53. "restoreState" : 0,
  54. "isEOF" : 1,
  55. "invalidates" : 0,
  56. "docsExamined" : 1,
  57. "alreadyHasObj" : 0,
  58. "inputStage" : {
  59. "stage" : "IXSCAN",
  60. "nReturned" : 1,
  61. "executionTimeMillisEstimate" : 0,
  62. "works" : 2,
  63. "advanced" : 1,
  64. "needTime" : 0,
  65. "needYield" : 0,
  66. "saveState" : 0,
  67. "restoreState" : 0,
  68. "isEOF" : 1,
  69. "invalidates" : 0,
  70. "keyPattern" : {
  71. "id" : 1
  72. },
  73. "indexName" : "id_1",
  74. "isMultiKey" : false,
  75. "multiKeyPaths" : {
  76. "id" : [ ]
  77. },
  78. "isUnique" : true,
  79. "isSparse" : false,
  80. "isPartial" : false,
  81. "indexVersion" : 2,
  82. "direction" : "forward",
  83. "indexBounds" : {
  84. "id" : [
  85. "[\"0101111\", \"0101111\"]"
  86. ]
  87. },
  88. "keysExamined" : 1,
  89. "seeks" : 1,
  90. "dupsTested" : 0,
  91. "dupsDropped" : 0,
  92. "seenInvalidated" : 0
  93. }
  94. },
  95. "allPlansExecution" : [ ]
  96. },
  97. "serverInfo" : {
  98. "host" : "T4F-MAM-13164.local",
  99. "port" : 27017,
  100. "version" : "3.6.5",
  101. "gitVersion" : "a20ecd3e3a174162052ff99913bc2ca9a839d618"
  102. },
  103. "ok" : 1
  104. }

3、思考总结

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注