Highlighted

Join Data with Array Data

Rookie Contributor
For the Google Merchant variables, I need to join the product SKU with the selected language. The language is included in a variable 'env_language' and could only be "nl" or "fr". The product SKU however could exist out of an array of multiple SKUs. When I apply the Join Data Values extension, and more than 1 SKUs exist, the new value is for example "12345\,6789-nl" (in case of 2 SKUs in the array). When there is only 1 SKU, there is of course no problem. Any suggestions how to solve this? Tx Siegert
7 REPLIES 7
Highlighted

Join Data with Array Data

Employee Emeritus
Siegert, The Join Data Values extension does not currently support joining individual array values. However, a JS Extension can be used to accomplish this. The code would look something like the below: b.sku_lang_concat = []; for(var i=0;i
Highlighted

Join Data with Array Data

Rookie Contributor
Works perfectly. Tx Jared!
Highlighted

Join Data with Array Data

Rookie Contributor
Awesome, this is exactly what i was hoping to find. (in my case a vendor need piped separated values instead of array) I have two additional questions : 1) what data type should i set my piped separated value? is it a UDO (as we refer to b. ) or is it a javascript? 2) do i need to make an if to check that the original variable has content? i.e. if (typeof product_sku !== 'undefined') { b.product_sku_piped = b.product_sku[0]; b.product_quantity_piped = b.product_quantity[0]; b.product_name_piped = b.product_name[0]; for(var i=1;i
Highlighted

Join Data with Array Data

Employee Emeritus
Philippe, Which vendor is this for? Usually our tag templates will take care of things like this. For example, Marin expects a pipe separated list of product information and our template will build all this for you based on the values in the Arrays so doing something like the above isn't necessary. Let me know which vendor this if for and I can advise a solution.
Highlighted

Join Data with Array Data

Rookie Contributor
This is for Rakuten Linkshare.
Highlighted

Join Data with Array Data

Employee Emeritus

LinkShare is a vendor that already has this logic built into the template. Our Template will join all values in Product SKU variable and delimit them with Pipes to create the "skulist" variable for LinkShare. It will also do the same thing for the "qlist" and "amtlist" variables. Linkshare also does not want any decimals in the product amounts. Our template will also handle this automatically so that all product prices are passed in cents and not dollar amounts. So in a nutshell, all the heavy lifting is taken care of automatically by our LinkShare Tag Template. All that is required of you is to add and configure the E-commerce Extension properly and configure the tag. The rest should already be done.

Highlighted

Join Data with Array Data

Rookie Contributor
Awesome !