Expand my Community achievements bar.

Join us WEDNESDAY, 6/7/23 @8am PT for the next Adobe Target Community Q&A Coffee Break! Bill Ozinga, John Mosbaugh, Justin Patrick, and Eric Thibeault will be taking all of your Target Recommendations questions in the chat ~ learn more and register today!
SOLVED

productPurchasedId does not work. Why?

Avatar

Level 2

We have created an MBOX for "order confirmation":
- Order ID: is a unique value
- ProductPurchaseId: is the product in the order

 

When we set the goals in Adobe Target:
- We can see the number of orders. We use MBOX = OrderConfirmPage
- But we CANNOT see the number of orders per product. We use MBOX = OrderConfirmPage + Audience / Targeting "ProductPurchaseID = IDProduct"

 

We don't know why, but the code should be well implemented and Adobe Target always gives us 0.

Any idea?

Thanks

Captura de pantalla 2021-06-15 a las 10.25.38.png

image001.png

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @carlosvelarde,

Second attempt, hopefully this is helpful. There are 3 ways/methods to pass a conversion mbox/location with order data in it to Target. If using at.js version 1.x you can use the first 2 methods only. If using at.js version 2.x you can use all 3 methods. I personally, prefer to use the #2 method with the trackEvent() since this request is generally only to send data to Target and is not used to get content to render to the page.

  1. Call the getOffer() method, and pass the order data as custom parameters with the reserved parameter names:
    1. orderId (unique id for the order) 
    2. orderTotal (value of the order - optional)
    3. productPurchasedId (comma separated list of skus included in the order like: "sku1,sku2,sku3" - optional)
    4. Example:

 

adobe.target.getOffer({
  "mbox": "orderConfirmation",
  "params": {
		"orderId":"ABC6789",
		"orderTotal":123.45,
		"productPurchasedId":"123,234,SLKF-123"
   },
  "success": function(offers) {
        adobe.target.applyOffer( { 
           "mbox": "orderConfirmation",
           "offer": offers 
        } );
  },
  "error": function(status, error) {
      if (console && console.log) {
        console.log(status);
        console.log(error);
      }
  },
 "timeout": 5000
});

 

  • Call the trackEvent() method and pass the order data as custom parameters with the reserved parameter names (same as getOffer() above).
    1. Example:

 

adobe.target.trackEvent({
	mbox: 'orderConfirmation',
	params: {
		"orderId":"ABC6789",
		"orderTotal":123.45,
		"productPurchasedId":"123,234,SLKF-123"
	}
});

 

  • Call the getOffers() method (only for at.js 2.x) with the order data in the orders object. Please note that parameter names are different from the methods above.
    1. Example:

 

adobe.target.getOffers({
  request: {
    execute: {
      mboxes: [{
          index: 0,
          name: "orderConfirmation",
          parameters: {
            "customParam": "value"
          },
          order: {
            "id": "ABC6789",
            "total": 123.45,
            "purchasedProductIds": ["123","234","SLKF-123"]
          }
      }]
    }
  }
})
.then(response => adobe.target.applyOffers({ response: response }))
.then(() => console.log("Success"))
.catch(error => console.log("Error", error));

 

Make sure your syntax is correct depending on the method you are employing. From your screen shot you appear to be using method #1 in which case you should be passing them as custom parameters with the exact names in the examples above - no leading or trailing spaces.

Hope that helps!

0 Replies

Avatar

Employee Advisor

Hi @carlosvelarde,

Your implementation looks to be fine. However, the reporting it sounds like you want to do is beyond Target reports. The passing of the productPurchasedId is for 2 main purposes in Target. 1) For informing Recommendations about specific entity/products getting purchased - to enable our purchase based algorithms. 2) To provide helpful information in the order details report download. I theory, if you downloaded the order details CSV you could determine the answer you are asking: how many orders included product X. Column H of the order details CSV will have a comma separated list of the productPurchasedIds in it that you could filter off of to answer your question.

Another way to answer that question would be in Analytics Workspace Analysis. If you have Analytics for Target (A4T) as your reporting source you should be able to create a report that gives you that information.

Avatar

Level 2
No, it does not work. If I download the CSV, I have the purchases received, but not what products they are for. Thanks for your help

Avatar

Employee Advisor
Ah, looking closer at your screen shot of your getOffers() it does appear like you have an extra space in the "productPurchasedId" key name. Can you double check that and try it without a trailing space?

Avatar

Level 2
Hi Ryan, No, it does not have an extra space. We have also tried with a custom parameter and not using the default "productPurchasedId" parameter, but it only works with the checkout and not the checkout page.

Avatar

Correct answer by
Employee Advisor

Hi @carlosvelarde,

Second attempt, hopefully this is helpful. There are 3 ways/methods to pass a conversion mbox/location with order data in it to Target. If using at.js version 1.x you can use the first 2 methods only. If using at.js version 2.x you can use all 3 methods. I personally, prefer to use the #2 method with the trackEvent() since this request is generally only to send data to Target and is not used to get content to render to the page.

  1. Call the getOffer() method, and pass the order data as custom parameters with the reserved parameter names:
    1. orderId (unique id for the order) 
    2. orderTotal (value of the order - optional)
    3. productPurchasedId (comma separated list of skus included in the order like: "sku1,sku2,sku3" - optional)
    4. Example:

 

adobe.target.getOffer({
  "mbox": "orderConfirmation",
  "params": {
		"orderId":"ABC6789",
		"orderTotal":123.45,
		"productPurchasedId":"123,234,SLKF-123"
   },
  "success": function(offers) {
        adobe.target.applyOffer( { 
           "mbox": "orderConfirmation",
           "offer": offers 
        } );
  },
  "error": function(status, error) {
      if (console && console.log) {
        console.log(status);
        console.log(error);
      }
  },
 "timeout": 5000
});

 

  • Call the trackEvent() method and pass the order data as custom parameters with the reserved parameter names (same as getOffer() above).
    1. Example:

 

adobe.target.trackEvent({
	mbox: 'orderConfirmation',
	params: {
		"orderId":"ABC6789",
		"orderTotal":123.45,
		"productPurchasedId":"123,234,SLKF-123"
	}
});

 

  • Call the getOffers() method (only for at.js 2.x) with the order data in the orders object. Please note that parameter names are different from the methods above.
    1. Example:

 

adobe.target.getOffers({
  request: {
    execute: {
      mboxes: [{
          index: 0,
          name: "orderConfirmation",
          parameters: {
            "customParam": "value"
          },
          order: {
            "id": "ABC6789",
            "total": 123.45,
            "purchasedProductIds": ["123","234","SLKF-123"]
          }
      }]
    }
  }
})
.then(response => adobe.target.applyOffers({ response: response }))
.then(() => console.log("Success"))
.catch(error => console.log("Error", error));

 

Make sure your syntax is correct depending on the method you are employing. From your screen shot you appear to be using method #1 in which case you should be passing them as custom parameters with the exact names in the examples above - no leading or trailing spaces.

Hope that helps!

Avatar

Level 2
Thanks Ryan for your answer. We have tried method 2 (trackEvent) and it doesn't work either.

Avatar

Administrator

Hi @carlosvelarde, hope you're doing well 🙂 Were you able to resolve this issue with the support that was provided? If so, please let us and your Target Community peers know by marking the helpful response as, "Correct Reply" - - otherwise, I'd encourage you to reach back out to your Community peers with a follow up question!

 

Warmly,

Amelia, your Adobe Target Community Manager

page footer