github.com/prebid/prebid-server/v2@v2.18.0/adservertargeting/test_data.go (about)

     1  package adservertargeting
     2  
     3  const (
     4  	reqValid = `{
     5    "id": "req_id",
     6    "imp": [
     7      {
     8        "id": "test_imp1",
     9        "ext": {"appnexus": {"placementId": 250419771}},
    10        "banner": {"format": [{"h": 250, "w": 300}]}
    11      },
    12      {
    13        "id": "test_imp2",
    14        "ext": {"appnexus": {"placementId": 250419771}},
    15        "banner": {"format": [{"h": 250, "w": 300}]}
    16      }
    17    ],
    18    "site": {"page": "test.com"}
    19  }`
    20  
    21  	reqInvalid = `{
    22    "id": "req_id",
    23    "imp": {
    24  	 "incorrect":true
    25     },
    26    "site": {"page": "test.com"}
    27  }`
    28  
    29  	reqNoImps = `{
    30    "id": "req_id",
    31    "site": {"page": "test.com"}
    32  }`
    33  
    34  	testUrl = "https://www.test-url.com?amp-key=testAmpKey&data-override-height=400"
    35  
    36  	reqFullValid = `{
    37    "id": "req_id",
    38    "imp": [
    39      {
    40        "id": "test_imp1",
    41        "ext": {"appnexus": {"placementId": 123}},
    42        "banner": {"format": [{"h": 250, "w": 300}], "w": 260, "h": 350}
    43      },
    44      {
    45        "id": "test_imp2",
    46        "ext": {"appnexus": {"placementId": 456}},
    47        "banner": {"format": [{"h": 400, "w": 600}], "w": 270, "h": 360}
    48      }
    49    ],
    50    "site": {"page": "test.com"}
    51  }`
    52  
    53  	reqFullInvalid = `{
    54    "imp": [
    55      {
    56        "ext": {"appnexus": {"placementId": 123}}
    57      },
    58      {
    59        "ext": {"appnexus": {"placementId": 456}}
    60      }
    61    ]
    62  }`
    63  
    64  	reqExt = `{
    65    "prebid": {
    66      "adservertargeting": [
    67        {
    68          "key": "hb_amp_param",
    69          "source": "bidrequest",
    70          "value": "ext.prebid.amp.data.ampkey"
    71        },
    72        {
    73          "key": "hb_req_imp_ext_param",
    74          "source": "bidrequest",
    75          "value": "imp.ext.prebid.test"
    76        },
    77        {
    78          "key": "hb_req_imp_ext_bidder_param",
    79          "source": "bidrequest",
    80          "value": "imp.ext.bidder1.tagid"
    81        },
    82        {
    83          "key": "hb_req_imp_param",
    84          "source": "bidrequest",
    85          "value": "imp.bidfloor"
    86        },
    87        {
    88          "key": "hb_req_ext_param",
    89          "source": "bidrequest",
    90          "value": "ext.prebid.targeting.includebrandcategory"
    91        },
    92  	  {
    93          "key": "hb_req_user_param",
    94          "source": "bidrequest",
    95          "value": "user.yob"
    96        },
    97        {
    98          "key": "hb_static_thing",
    99          "source": "static",
   100          "value": "test-static-value"
   101        },
   102        {
   103          "key": "{{BIDDER}}_custom1",
   104          "source": "bidresponse",
   105          "value": "seatbid.bid.ext.custom1"
   106        },
   107        {
   108          "key": "custom2",
   109          "source": "bidresponse",
   110          "value": "seatbid.bid.ext.custom2"
   111        },
   112        {
   113          "key": "{{BIDDER}}_imp",
   114          "source": "bidresponse",
   115          "value": "seatbid.bid.impid"
   116        },
   117        {
   118          "key": "seat_cur",
   119          "source": "bidresponse",
   120          "value": "cur"
   121        }
   122      ],
   123      "targeting": {
   124        "includewinners": false,
   125        "includebidderkeys": true,
   126        "includebrandcategory": {
   127          "primaryadserver": 1,
   128          "publisher": "",
   129          "withcategory": true
   130        }
   131      }
   132    }
   133  }`
   134  
   135  	seatBid0Bid0Ext = `{
   136    "prebid": {
   137      "foo": "bar1",
   138      "targeting": {
   139        "appnexus_custom6": "true",
   140        "custom2": "bar1",
   141        "custom3": "10",
   142        "custom4": "barApn",
   143        "custom5": "USD",
   144        "custom6":"testResponse", 
   145        "custom7":"testBidId", 
   146        "custom8":"testCustomData", 
   147        "custom9":"2",
   148        "hb_amp_param": "testAmpKey",
   149        "hb_imp_param": "111"
   150      }
   151    }
   152  }`
   153  
   154  	seatBid0Bid1Ext = `
   155  {
   156    "prebid": {
   157      "foo": "bar2",
   158      "targeting": {
   159        "appnexus_custom6": "true",
   160        "custom2": "bar2",
   161        "custom3": "20",
   162        "custom4": "barApn",
   163        "custom5": "USD",
   164        "custom6":"testResponse", 
   165        "custom7":"testBidId", 
   166        "custom8":"testCustomData", 
   167        "custom9":"2",
   168        "hb_amp_param": "testAmpKey",
   169        "hb_imp_param": "222"
   170      }
   171    }
   172  }`
   173  	seatBid0Bid2Ext = `
   174  {
   175    "prebid": {
   176      "foo": "bar3",
   177      "targeting": {
   178        "appnexus_custom6": "true",
   179        "custom2": "bar3",
   180        "custom3": "30",
   181        "custom4": "barApn",
   182        "custom5": "USD",
   183        "custom6":"testResponse", 
   184        "custom7":"testBidId", 
   185        "custom8":"testCustomData", 
   186        "custom9":"2",
   187        "hb_amp_param": "testAmpKey",
   188        "hb_imp_param": "333"
   189      }
   190    }
   191  }`
   192  
   193  	seatBid1Bid0Ext = `{
   194    "prebid": {
   195      "foo": "bar11",
   196      "targeting": {
   197        "custom2": "bar11",
   198        "custom3": "11",
   199        "custom4": "barRubicon",
   200        "custom5": "USD",
   201        "custom6":"testResponse", 
   202        "custom7":"testBidId", 
   203        "custom8":"testCustomData", 
   204        "custom9":"2",
   205        "hb_amp_param": "testAmpKey",
   206        "hb_imp_param": "111",
   207        "rubicon_custom6": "true",
   208        "testInput": 111
   209      }
   210    }
   211  }`
   212  	seatBid1Bid1Ext = `
   213  {
   214    "prebid": {
   215      "foo": "bar22",
   216      "targeting": {
   217        "custom2": "bar22",
   218        "custom3": "22",
   219        "custom4": "barRubicon",
   220        "custom5": "USD",
   221        "custom6":"testResponse", 
   222        "custom7":"testBidId", 
   223        "custom8":"testCustomData", 
   224        "custom9":"2",
   225        "hb_amp_param": "testAmpKey",
   226        "hb_imp_param": "222",
   227        "rubicon_custom6": "true",
   228        "testInput": 222
   229      }
   230    }
   231  }`
   232  
   233  	seatBid1Bid2Ext = `{
   234    "prebid": {
   235      "foo": "bar33",
   236      "targeting": {
   237        "custom2": "bar33",
   238        "custom3": "33",
   239        "custom4": "barRubicon",
   240        "custom5": "USD",
   241        "custom6":"testResponse", 
   242        "custom7":"testBidId", 
   243        "custom8":"testCustomData", 
   244        "custom9":"2",
   245        "hb_amp_param": "testAmpKey",
   246        "hb_imp_param": "333",
   247        "rubicon_custom6": "true",
   248        "testInput": 333
   249      }
   250    }
   251  }`
   252  
   253  	bid0Ext = `{"prebid": {"foo":"bar1", "targeting": {"custom_attr":"bar1"}}}`
   254  	bid1Ext = `{"prebid": {"foo":"bar2", "targeting": {"custom_attr":"bar2"}}}`
   255  	bid2Ext = `{"prebid": {"foo":"bar3", "targeting": {"custom_attr":"bar3"}}}`
   256  
   257  	apnBid0Ext = `{
   258    "custom1": 1111,
   259    "custom2": "a1111",
   260    "prebid": {
   261      "foo": "bar1",
   262      "targeting": {
   263        "appnexus_custom1": "1111",
   264        "appnexus_imp":"imp1",
   265        "custom2": "a1111",
   266        "hb_amp_param": "testAmpKey",
   267        "hb_req_imp_ext_bidde": "111",
   268        "hb_req_imp_param": "10",
   269        "hb_req_user_param": "2000",
   270        "hb_static_thing": "test-static-value",
   271        "seat_cur":"USD"
   272      }
   273    }
   274  }`
   275  
   276  	apnBid1Ext = `{
   277    "custom1": 2222,
   278    "custom2": "a2222",
   279    "prebid": {
   280      "foo": "bar2",
   281      "targeting": {
   282        "appnexus_custom1": "2222",
   283        "appnexus_imp":"imp2",
   284        "custom2": "a2222",
   285        "hb_amp_param": "testAmpKey",
   286        "hb_req_imp_ext_bidde": "222",
   287        "hb_req_imp_param": "20",
   288        "hb_req_user_param": "2000",
   289        "hb_static_thing": "test-static-value",
   290        "seat_cur":"USD"
   291      }
   292    }
   293  }`
   294  	apnBid2Ext = `{
   295    "custom1": 3333,
   296    "custom2": "a3333",
   297    "prebid": {
   298      "foo": "bar3",
   299      "targeting": {
   300        "appnexus_custom1": "3333",
   301        "appnexus_imp":"imp3",
   302        "custom2": "a3333",
   303        "hb_amp_param": "testAmpKey",
   304        "hb_req_imp_ext_bidde": "333",
   305        "hb_req_imp_param": "30",
   306        "hb_req_user_param": "2000",
   307        "hb_static_thing": "test-static-value",
   308        "seat_cur":"USD"
   309      }
   310    }
   311  }`
   312  
   313  	rbcBid0Ext = `{
   314    "custom1": 4444,
   315    "custom2": "r4444",
   316    "prebid": {
   317      "foo": "bar11",
   318      "targeting": {
   319        "custom2": "r4444",
   320        "rubicon_imp":"imp1",
   321        "hb_amp_param": "testAmpKey",
   322        "hb_req_imp_ext_bidde": "111",
   323        "hb_req_imp_param": "10",
   324        "hb_req_user_param": "2000",
   325        "hb_static_thing": "test-static-value",
   326        "rubicon_custom1": "4444",
   327        "testInput": 111,
   328        "seat_cur":"USD"
   329      }
   330    }
   331  }`
   332  	rbcBid1Ext = `{
   333    "custom1": 5555,
   334    "custom2": "r5555",
   335    "prebid": {
   336      "foo": "bar22",
   337      "targeting": {
   338        "custom2": "r5555",
   339        "rubicon_imp":"imp2",
   340        "hb_amp_param": "testAmpKey",
   341        "hb_req_imp_ext_bidde": "222",
   342        "hb_req_imp_param": "20",
   343        "hb_req_user_param": "2000",
   344        "hb_static_thing": "test-static-value",
   345        "rubicon_custom1": "5555",
   346        "testInput": 222,
   347        "seat_cur":"USD"
   348      }
   349    }
   350  }`
   351  	rbcBid2Ext = `{
   352    "custom1": 6666,
   353    "custom2": "r6666",
   354    "prebid": {
   355      "foo": "bar33",
   356      "targeting": {
   357        "custom2": "r6666",
   358        "rubicon_imp":"imp3",
   359        "hb_amp_param": "testAmpKey",
   360        "hb_req_imp_ext_bidde": "333",
   361        "hb_req_imp_param": "30",
   362        "hb_req_user_param": "2000",
   363        "hb_static_thing": "test-static-value",
   364        "rubicon_custom1": "6666",
   365        "testInput": 333,
   366        "seat_cur":"USD"
   367      }
   368    }
   369  }`
   370  )