Over-index condition:
This condition checks whether a product is performing significantly above the set
target.
config.addToOverIndex: This is a setting which, if true, allows products to be classified as 'over-index'.
productData.clicks > ((100 * config.clickMultiplier) / averageConversionRate): This part checks if the product has enough clicks. It uses a special calculation that takes into account the average conversion rate and a multiplier.
convValuePerCost >= config.targetRoas + (config.percentageDifferenceTarget / 100 * config.targetRoas): This checks if the return on ad spend (ROAS) is above the target ROAS by a certain percentage. If these conditions are all met, the product is performing much better than the target and is labeled as 'over-index'.
Index condition:
This condition checks whether a product is performing at or slightly above the target.
productData.clicks >= (100 / averageConversionRate): This part checks if theproduct has enough clicks, this time using the average conversion rate.
convValuePerCost >= config.targetRoas: This checks if the ROAS is at least as high as the target. If these conditions are met, the product is performing well and is labeled as 'index'.
Near-index condition:
This condition checks whether a product is performing slightly below the target.
convValuePerCost >= (config.targetRoas - (config.percentageDifferenceTarget / 100 * config.targetRoas)): This checks if the ROAS is at least as high as the target, minus a certain percentage. If this condition is met, the product is performing slightly below target but still close, and is labeled as 'near-index'.
Under-index condition:
This condition checks whether a product is performing below the target.
productData.conversions > 1 || productData.clicks > (100 / averageConversionRate): This checks if the product has more than one conversion or if it has enough clicks. If one of these conditions is met, but the product's ROAS is not meeting the conditions of the above labels, the product is not performing well and is labeled as 'under-index'.
No-index condition:
If a product doesn't meet any of the conditions for the above labels, it is labeled as
'no-index'. This usually means it has very low conversions and clicks.
