This plugin aims to fix over attribution when you use multiple different marketing platforms, by connecting UTM parameters directly to orders.
![]()
When using multiple marketing platforms, each platform has their own attribution model, and each doesn't know what the other already attributed. This can lead to over attribution, or double-attribution. This means your ROAS or ROI might look better than it actually is.
This plugin connects UTM parameters directly to orders, so that attribution can never exceed the actual value of an order. This might lead to slight under-attribution, but never to over attribution.
vendure-config.tsThis plugin shows UTM parameters on the order detail page, but doesn't include diagrams or charts. You should use your own data visualization or BI tool to visualize the data.
Most platforms like Klaviyo or Google Ads allow you to automatically add UTM parameters to your campaigns. This is needed to extract the parameters on your storefront.
To add parameters to an order, you can use the addUTMParametersToOrder mutation:
Keep in mind that UTM parameters can only be added to an active order! On most page visits, an active order is not present yet, so you should save the parameters in a cookie or local storage, along with the connectedAt date, and add them to the order when the order is created. You should not create a new order for each page visit, because this drastically increase the amount of orders in your database (Most visitors will never create an order, so this is a waste of resources).
You should do something like this in your storefront:
This plugin doesn't include any visualization by default, but you can easily write your own insights with SQL. For example, this query will give you the total attributed revenue per source:
You can use different GROUP BY clauses to get the total attributed revenue per medium, campaign, term, content, etc.
getCampaignDisplayNameutm-util.js file to the README.mdconnectedAt date from client, because UTM parameters are saved on the client first