Emanuel Berg: maintaining and developing a menswear brand’s Magento store
We took care of maintaining and developing Emanuel Berg’s Magento 2 store, simplified deployments and shipped features faster: a newsletter with discounts, Consent Mode v2, stock levels.
- 13 mo.
- of active store development with our team
- 53
- merge requests in GitLab
- 4
- custom Magento modules
- 3
- Endora people on the project
- Client
- Emanuel Berg
- Industry
- Premium menswear: shirts, knitwear and jackets made in a European atelier since 1989
- Scope
- Magento 2 store maintenance and development, FreshMail integration, newsletter with discount codes, Google Consent Mode v2, cookie scanner, stock levels and import, GA4 and Meta analytics, CI/CD to the testing environment, fixes and module updates
- Cooperation period
- Since January 2024
- Technologies used
- Magento 2PHPJavaScriptMySQLGitLab CI/CDAnsibleDocker
Emanuel Berg is a premium menswear brand that has been making shirts from Italian cloth in its own European atelier since 1989. Its range includes shirts, knitwear, polos, blazers and jackets, as well as made-to-measure tailoring. The brand sells through partner retailers and online, including through a Magento 2 store.
In January 2024 the brand asked us to take care of maintaining and developing the store. The store was slow, and the infrastructure and deployment processes left by the previous vendor were too complex for the scale of this Magento instance. We started by simplifying and organizing the process, and then for 13 months developed the store end to end: marketing, cookie consent and analytics, and stock level logic.
Getting started and simpler deployments
When we start working on a store built by another team, the first question is: what exactly is running in production? According to the previous vendor’s documentation, the last update took place in June 2023. We moved the code to our GitLab repository, ran the store locally on a copy of the data and only then started making changes. We kept the existing modules, including the stock integration, Przelewy24 payments and InPost shipping, and fixed them wherever sales required it.
We replaced the complex infrastructure and deployment process with a simpler one, matched to the store’s real needs. Every change is made on a separate branch and goes into a merge request. After a merge into the dev branch, a GitLab CI pipeline with Ansible updates the testing environment on its own: it enables maintenance mode, pulls the code, installs dependencies, runs database migrations, builds the styles and disables maintenance mode. Only what has been checked on testing goes to production.
For the business this meant new features reached the store faster, maintenance took less work, and no change was deployed “live” without checks.
A newsletter that rewards sign-ups with a discount code
The brand grows its mailing list in FreshMail. We connected Magento to it and wrote our own newsletter module. Customers sign up in a popup or a form on the page, accepting the required consents. The store checks in FreshMail whether the address is already subscribed, subscribes the customer in Magento, and when syncing with FreshMail generates a single-use discount code for them based on a cart price rule selected in the admin panel. The code goes into a field in FreshMail, so the welcome e-mail contains a discount assigned to that one person.
The popup and the form are widgets: marketing sets the title, description, consent text, post-sign-up message and whether the popup should be shown to logged-in customers. We disabled Magento’s default newsletter e-mails so customers don’t get two messages, and we send every sign-up to the dataLayer as an event that marketing measures in Google Analytics 4.
For the business this means a growing mailing list, an incentive for the first purchase and codes that cannot be passed on, because each one works only once.
Google Consent Mode v2 and a cookie scanner
Since March 2024 Google has required Consent Mode v2 for advertising campaigns and analytics to use data from users in the European Economic Area. We wrote a custom consent module for the store. The dialog shows four cookie categories: essential, preferences, statistics and marketing. Google tags start with consent denied and switch on measurement and ad personalization only in line with the customer’s choice. It took 11 days from the first commit to production deployment.
A store changes over time: new scripts and new cookies are added. That is why we added a “Scan website for cookies” button to the Magento admin panel, which sends a scan request for the store to our cookie detection tool. When the scan finishes, the cookie list, split into categories, is saved in the configuration, separately for each store version, and the consent dialog shows the current data right away.
For the business this means compliance with Google’s requirements and the GDPR without losing data for campaigns, and a cookie list that does not have to be compiled by hand.
Product availability that matches the warehouse
Stock levels reach the store through an import of an XML file from an FTP server. The problem was that the “in stock” status did not always keep up with the quantity. We wrote a module that after every order and every import calculates the real quantity available for sale: the stock level minus reservations from open orders and the configured minimum threshold. When the quantity drops to zero, the product is taken off sale. When goods come back, the product returns to the offer on its own.
When an issue with stock levels not changing after an order was reported in November 2024, the fix reached production the same day. A few days later we removed the second cause: the import did not match products when the SKU in the file differed in letter case.
For the business this means fewer cancelled orders, fewer disappointed customers and no manual monitoring of availability.
Ongoing development and maintenance
Beyond the larger features, we took care of the store’s day-to-day health: WebP image support, fixes to the InPost module and the Omnibus pricing module, a Meta (Facebook) integration for campaigns, patches fixing admin panel login and the calendar on the product page, and restoring the look of the related products block on the product page, which the GA4 module had overridden. Each of these changes went through the same process: merge request, testing environment, approval, production.
Technology in the background
The store runs on Magento 2 Open Source with the brand’s theme, and the testing environment runs in Docker containers. The code lives in GitLab, and deployments to the testing environment are handled by a GitLab CI pipeline with an Ansible playbook. Our extensions are four Magento modules in PHP and JavaScript, integrated with FreshMail, Google Tag Manager and GA4. Have a store built by another team and looking for a partner to develop it further? See how we handle platform maintenance and development, or let’s talk about your project.
Diagnosis
What needed solving?
Infrastructure beyond the need
The store was slow, and the infrastructure and deployment process left by the previous vendor were too complex for the scale of this Magento instance. Maintenance took more work than necessary, and new features came slowly.
A newsletter without an incentive
The brand wanted to grow its mailing list in FreshMail and reward sign-ups with a discount code. Magento’s standard newsletter did not talk to FreshMail and did not generate codes.
New Google requirements
Since March 2024 Google has required Consent Mode v2 for ads and analytics to use data from users in the European Economic Area. The store needed a new consent dialog.
Stock levels drifting apart
Products that were gone could stay on sale, and products back in stock did not automatically return to the offer. Some of the problems came from the stock import.
Solution
What Emanuel Berg got
A simpler deployment process
A process matched to the store’s scale: code in GitLab, work on branches and merge requests, and a pipeline that updates the testing environment after every change. Production gets only changes checked on testing.
A newsletter with a discount code
A sign-up popup and widget that marketing configures in the admin panel. Every new subscriber gets a single-use discount code in FreshMail, and the sign-up reaches GA4 as an event.
Google Consent Mode v2
A consent dialog with four cookie categories. Google tags collect no data by default and switch on only in line with the customer’s choice.
A cookie scanner in the admin panel
One button in the Magento admin panel starts a scan of the store and fills in the cookie list shown to customers, separately for each store version.
Availability that matches the warehouse
After every order and stock import the store recalculates the quantity available for sale and hides or restores the product on its own.
Maintenance and smaller improvements
WebP images, fixes to the InPost and Omnibus modules, a Meta integration, and fixes to the admin panel and product page.
How we worked
From an orderly process to continuous development
- 01
Getting started and simplifying (January - March 2024)
We moved the code to our GitLab, ran the project locally and replaced the complex deployment process with a simple GitLab CI pipeline with Ansible that deploys the dev branch to the testing environment.
- 02
Marketing and newsletter (February - March 2024)
FreshMail integration, discount code generation and a newsletter popup. The first changes reached production at the end of March.
- 03
Consent and analytics (March - May 2024)
Consent Mode v2 went from the first commit to production in 11 days, followed by the cookie scanner, a newsletter sign-up event in the dataLayer and the Meta module.
- 04
Stock levels (April - November 2024)
Automatic product availability after orders and imports, and, after another issue was reported, an import fix deployed to production the same day.
- 05
Continuous development (2024 - 2025)
Every change took the same path: branch, merge request, testing environment, approval and a merge to master, which went to production.
Results
What did Emanuel Berg gain?
- ✓ Infrastructure and deployments matched to the store’s scale, and as a result faster delivery of new features
- ✓ A growing FreshMail mailing list in which every new sign-up gets a discount code
- ✓ Cookie consent compliant with Google Consent Mode v2, without losing data for Google campaigns
- ✓ The cookie list in the consent dialog updated by a scan from the admin panel, with no manual inventory
- ✓ Customers don’t buy products that are out of stock, and goods back in the warehouse return to sale on their own
- ✓ Safe deployments: every change goes to the testing environment first
See next
More case studies

New sales platform
Endora Commerce: 12 years of B2B rollouts in one platform
How the Endora core team turned 120+ B2B rollouts into Endora Commerce: open source under the MIT licence, 80 modules and a live demo you can test.

Platform migration
DKM Power Transmission. Sales Platform
From an unstable platform and abandoned carts to a 2 pp conversion increase.
Have a specific challenge?
Don't just read about it - let's talk about your case.