Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How to correctly pass 3rdPartyId to Target? Is our code Correct?

magnorm1697409
Level 2
Level 2
We are looking to use Target to test the effect of removing a feature (X). We wanted to ensure this won’t have a negative impact in the conversion rate before we permanently remove this feature X. So the requirements are:
  1. For first time user, split into one of 2 groups. Group A is default experience. Group B is new experience minus feature X.
  2. User is identified by account number.
  3. For repeat user with same account #, always put them in the group assigned in step 1.

We have tried to use thirdPartyId = account number and getOffer function to achieve this:

adobe.target.getOffer({
  "mbox": "target-global-mbox",
  "params": {
    "mbox3rdPartyId": '111234978',
    "activity.id":"253444"
  },
  "success": function(offer) {        
        console.log(offer)
  }, 

  "error": function(status, error) {        
      console.log('Error', status, error);
  }
});

The issue we are facing is, regardless of what mbox3rdPartyId we pass, we consistently get only the same variant of the offer. It looks like we are not passing thirdPartyId correctly

Full Code Below

<!DOCTYPE html>

<html>

<meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

<head>

<title>Test Page</title>

<script>

function targetPageParamsAll() {

   var id = Math.floor(Math.random() * 1000000);

    return {

    "at_property": "2d78ac2b-960b-fa51-150f-a111bc4696b0",

    "mbox3rdPartyId":"id" + id

   

   };

}

</script>

<script src="at.js"></script>

</head>

<body>

<!--<script>

document.addEventListener(adobe.target.event.REQUEST_SUCCEEDED, function(e) {

console.log('REQUEST_SUCCEEDED', event);

});

</script> -->

<button onclick="clickFn()">Get Offer</button>

<div id="test">

</div>

<script type="text/javascript">

   function targetPageParams() {

    return {

    "at_property": "2d78ac2b-960b-fa51-150f-a111bc4696b0",

   

   };

}

</script>

<script>

function clickFn(){

var id = Math.floor(Math.random() * 1000000);

adobe.target.getOffer({ 

  "mbox": "target-global-mbox",

  "params": {

  "activity.id":"253444",

  "mbox3rdPartyId":"id" + id

  },

  "success": function(offer) {         

        console.log(offer[1]["content"][0])

        document.getElementById('test').innerText = "Creditcard:" + offer[1]["content"][0]["creditcard"]

       

  }, 

  "error": function(status, error) {         

      console.log('Error', status, error);

  }

});

}

</script>

</body>

</html>

0 Replies