async, defer or type="module": pagent needs to load before your page shows, so visitors never see the original flash.
Option 1: a head-code plugin
This works without a developer.1
Find a head-code plugin
In the Shopware Store, search for a plugin that adds custom scripts or HTML to the
<head>, for example with the words “custom scripts”, “HTML head” or “tracking code”.2
Install it
In your Shopware admin, go to Extensions → My extensions, then install and activate the plugin.
3
Paste the snippet
Open the plugin’s configuration and paste your snippet into its head field. If it asks where to place the code, choose the head, as early as possible.
4
Save and clear the cache
Save, then clear the shop cache under Settings → System → Caches & indexes.
These plugins come from other providers, not from Shopware or pagent. Choose one that is compatible with your Shopware version.
Option 2: your theme (for developers)
In your own theme or plugin, extend the storefront’smeta.html.twig and add the snippet to the layout_head_meta_tags block, at the top of <head>:
bin/console cache:clear.
pagent runs on your storefront pages. Your checkout pages are part of the storefront in Shopware too, so the snippet loads there as well.
Check it worked
- Open your site in a private browser window, so no cached version shows.
- Back in pagent, click Check connection in the install step. If you’ve finished setup already, open Settings → Setup: it shows You are ready once pagent has received visits from your site.
- pagent loads your live site and looks for the snippet. When it finds it, you can start your first test.