Your Shopware shop is successful, but you'd like to reach more potential buyers? Then you'll benefit from the many opportunities Shopware offers you. Export your products to promote them dynamically on social media networks and attract potential buyers to your shop. We'll show you step by step how this works, using Facebook and Instagram as examples.
Basics & Requirements
Facebook gives you the ability to promote your products in ads on both the Facebook and Instagram feed, in order to direct interested users to your shop. To promote your products accordingly, you first need a private Facebook account as well as a Facebook page or an Instagram account for your business. To link all accounts together and run ads, you should also set up the Facebook Business Manager. Afterwards, an automatic product export from Shopware to Facebook can be set up to run dynamic ads with your products.
Setting up the Shopware Product Export
The first step is to export your shop's products to Facebook. So that you don't always have to do this manually, and to also take current stock levels and prices into account, we recommend using the product export in Shopware. With this, you can export your products automatically in a variety of formats. You'll find the product export in the Shopware Backend under Marketing → Product Exports. Create a new configuration there and assign a title, file name, and, if needed, any PartnerID to attribute sales to the respective platform. As the retrieval method, we recommend Live, so that the data is regenerated on every request. In the area on the right, you should also select the shop to use, the customer group, and a currency.
In the Formatting tab, you need to set CSV as the file format and UTF-8 as the character encoding for Facebook. The Header tab defines the columns and thus which product information should be included in the later data. The columns included in the code example below correspond to the minimum requirements for ads on Facebook and Instagram. However, especially for dynamic ads with advanced audience targeting, additional fields can also be useful. Here you'll find a list of all variables and their required formatting.
Code for the header:
{strip}id{#S#}title{#S#}description{#S#}image_link{#S#}link{#S#}gtin{#S#}mpn{#S#}brand{#S#}condition{#S#}product_type{#S#}price{#S#}shipping{#S#}availability{/strip}{#L#}The Template code then uses the Smarty templating engine to generate the corresponding values for the product information, creating one row per product in the resulting CSV file. This way, you can also make additions and custom calculations, for example for a special shipping cost configuration. You'll find an overview of all variables and commands available in Shopware in the Shopware documentation. The closing footer is only relevant for XML exports and isn't needed for the Facebook export.
Code for the template:
{strip}{$sArticle.ordernumber|escape}{#S#}{$sArticle.name|strip_tags|strip|trim|truncate:150:"...":true|escape|regex_replace:"#[^w.%&-+ |]#iu":""|replace:";":","}{#S#}{$sArticle.description_long|strip_tags|strip|trim|truncate:1000:"...":true|escape|regex_replace:"#[^w.%&-+ |]#iu":""|replace:";":","}{#S#}{$sArticle.image|image}{#S#}"{$sArticle.articleID|link:$sArticle.name|escape|replace:'"':""}{if $sArticle.additionaltext}?number={$sArticle.ordernumber|replace:'"':""}{/if}"{#S#}{$sArticle.ean|escape}{#S#}{$sArticle.suppliernumber|escape}{#S#}{$sArticle.supplier|replace:"|":""}{#S#}new{#S#}{$sArticle.articleID|category:">"|escape|replace:"|":""}{#S#}{$sArticle.price|escape:"number"}{#S#}DE::Standardversand:{if $sArticle.shippingfree==1}0.00 EUR{else}{$sArticle|@shippingcost:"prepayment":"de":"Standard Versand (DE)"|escape:"number"|replace:",":"."} EUR{/if}{#S#}"{if $sArticle.instock>0}in stock{elseif $sArticle.releasedate && $sArticle.releasedate|strtotime > $smarty.now}preorder{elseif $sArticle.shippingtime}in stock{else}out of stock{/if}"{/strip}{#L#}If you want to exclude specific product categories, manufacturers, or items from the export, you can define this in the corresponding filters in the other tabs. It's also a good idea to restrict the export to active items in the Additional Filters tab. Optionally, you can also set Stock greater than or equal to to a minimum stock level, so that items are otherwise not exported — and thus not promoted — until stock has been replenished. In addition, for Facebook and Instagram, only items with images should be exported so that they're presented attractively.
After all settings have been made, save the configuration. Now you can use the lightning icon next to the corresponding entry to perform an initial calculation of the values and test the product export. This opens a new window showing the generated data. Carefully check the calculated values and make changes if necessary. Finally, you should save the URL of the window, since Facebook needs it in the next step to retrieve the product information.
Creating a Facebook Product Catalog
To make the product information available to Facebook or Instagram, open the Facebook Business Manager and create a new product catalog under Assets → Catalogs in the menu. In the first selection dialog, choose eCommerce, and in the second step, Upload product info. Give the catalog a custom name and click Create.
Then open the new catalog, switch to the Data Sources section, and click Add products. Since we want to regularly import the product data using the product export we created, we select Use bulk upload.
In the next step, select Scheduled feed as the upload option, and then enter the URL you copied earlier. If you need the URL again, you can click on the name of the created export in the list of product exports in the Shopware Backend to open the window again. A username isn't needed in the Business Manager.
Finally, you need to set up a schedule for the update. If your Shopware shop needs noticeable performance while generating the product export, we recommend a daily update outside of regular business hours. In this case, you should also disable the option for automatic updates. You can then save the data source and run the product import for the first time. Facebook will now process all products listed at the URL, update any product information already recorded, and retrieve the associated images.
Setting Up Remarketing and Running Ads
Once the product catalog has been successfully created, you can now run ads. To increase the effectiveness of the advertising campaign, it's a good idea to narrow the target audience down to previous shop visitors and show them matching products. For this, you can set up retargeting using a Facebook Pixel. This lets Facebook capture selected activities of your shop visitors, such as product views or cart contents. To install the Facebook Pixel in your shop, numerous plugins are available in the Shopware Community Store. However, note that the pixel may only be activated if shop visitors have consented to its use.
Finally, all that's missing is the actual ads. To create these, open the Ads Manager section in the Facebook Business Manager and create a new campaign. To make sure the ads include products from your catalog, select Catalog sales as the objective. You can then select the created product catalog in the section below.
Now, in the following steps, create an associated ad set. Here you can choose the Placement to determine whether you want to run the campaign on Instagram or Facebook. In addition, you should create a Custom Audience as your Audience, containing the shop visitors captured by the Facebook Pixel. Finally, you need the actual ad itself, which selects matching products from your created catalog and presents them to the Facebook or Instagram user. Here you'll find more information on creating dynamic ads. Now your campaign can start.
Tip: The Facebook Pixel can also capture sales, so the success of your ads can be evaluated and optimized directly in the Facebook Ads Manager.
