Adding margin attribute and using it for campaign optimization

Adding margin to attributes in the product feed allows for better control over the products being sent to specific publishers in terms of cost optimization.

1) First, we should generate a CSV file with information about the margin for each product. We recommend creating a new file, for example, on Google Sheets. Giving it a suitable name will allow for quick searching. We name the columns: "id" and "margin". Then, in the file, the "id" column should contain the IDs of the products to which we assign the appropriate margin. It is important to remember that numerical values in the "margin" column, if they are fractional, must be separated by dots, not commas.

2) Next you should publish the spreadsheet on the web as a CSV file and copy the file link.

3) The next step will be to add the created Google Sheet to the system as a child import. To do this, you need to add a new import in the "Imports" tab by clicking the "Add import" button. In the import window, set the source to "Google Sheet", give it an appropriate name, such as Margin, add the link to the copied Google Sheet CSV file, and save it. Given that everything went according to the procedure, the "Set Mapping" button will appear.


4) After clicking the "Set mapping" button, we go to the product mapping tab. At this point, we need to create a new variable, for example, "margin" and save it. Then, using drag and drop, connect the "id" variable with "id" and the "margin" variable with "margin". Click save and go back to the "Imports" tab.

5) In the imports tab, click "Adjust Changes". At this point, the main file is merged with the Marigin file. 

Thus, the attribute "margin" has been added to the product attributes.



6) At this point, you can create a rule that excludes products with a specific margin. For example, if you wanted to exclude products with a margin below 5%, you can set the following rule: