TypeError: this.settings.productCollectionPath.replace is not a function at r.getProductCollectionPath

Avatar

Avatar

digitaldarpan

Avatar

digitaldarpan

digitaldarpan

06-04-2021

We are trying to generate “s.products” Adobe Analytics variable using AA Product String Builder via Launch. Unfortunately I am getting below errors on console.

digitaldarpan_0-1617697035489.jpeg


I am quoting necessary information below:

1. Rule structure on launch

digitaldarpan_1-1617697069913.jpeg

 

2. Action configuration for AA Product String Builder.

digitaldarpan_2-1617697091406.jpeg

 

3. DataLayer structure

digitaldarpan_3-1617697113523.jpeg

 

4. ‘Product collection path’ value passed by “eComm - productString” data elememt.

digitaldarpan_4-1617697143339.jpeg


Could you please help me on this?

AA Product String Builder Adobe Analytics commerce launch

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

yuhuisg

MVP

Avatar

yuhuisg

MVP

yuhuisg
MVP

06-04-2021

Unfortunately, your setup isn't going to work.

AA Product String Builder expects your Root Data Object to look like this:

 

{
  products: [
    {
      id: '...',
      name: '...',
      price: ...,
      quantity: ...
    },
    {
      id: '...',
      name: '...',
      price: ...,
      quantity: ...
    },
    ...
  ]
}

 

In that case, the Product Collection Path would be set to the static string "products".

One quick solution is to use a Custom Code data element to nest your products array inside a key-value object, e.g.

 

return {
  products: _satellite.getVar("eComm - productString");
};

 

Then use that Custom Code data element as your Root Data Object in the AA Product String Builder, and "products" as your Product Collection Path.