Install Benson on Shopware
Add the Benson snippet to Shopware 6's storefront head with a theme or plugin template, clear the cache, and check it's live.
Jump to a section
Shopware 6 has no box for head scripts in the Administration. Add Benson through a storefront template in your theme or plugin using one small Twig file. Choose Other as your platform in the setup wizard.
Your snippet#
Your real snippet, with your site key, is in the setup wizard and under Settings → Install:
<script async src="https://cdn.trybenson.com/benson.js" data-site="pk_live_YOUR_SITE_KEY"></script>Add it to Shopware#
- In your theme or plugin, create
src/Resources/views/storefront/layout/meta.html.twigwith the template below, and paste your snippet where indicated. - Activate the theme or plugin. If it's a theme, assign it to your sales channel.
- Clear the cache with
bin/console cache:clear.
{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
{% block layout_head_javascript_hmr_mode %}
{{ parent() }}
{# Paste your Benson snippet here #}
{% endblock %}
The block is in Shopware 6.5, 6.6 and 6.7.
Check it's live#
Open your store in a normal browser tab. The setup wizard shows Verified: Benson is live within a few seconds. If it doesn't, see Troubleshooting.
Good to know#
- Shopware's checkout pages use the same layout, so the snippet reaches checkout. Benson hides extension pop-ups and guards the coupon field there.
- If your store uses Shopware's cookie consent, Consent and storage lists what Benson stores in the browser.
Stuck? Email [email protected].
