My store is now connected to GA4. However, I noticed that the shipping fee is not being included in order data on Google Analytics. How do I get GA4 to record the shipping fee for each order?
Hello @Jihan_Shareef ,
I am Gina from flareAI app helping Shopify merchants get $5Million+ in sales from Google Search, on autopilot. Hope you are having a good day.
To track the shipping fee for each order on Google Analytics 4 (GA4), you can set up a custom event that fires when the order is completed and includes the shipping fee as a custom parameter. Hereâs how you can do it.
-
Set up a custom event trigger
In your GA4 account, go to âAdminâ and select âData Streamsâ from the âPropertyâ column. Then, click on the data stream that corresponds to your Shopify store and select âTaggingâ from the left-hand menu. Click on âCreate Eventâ and set the trigger to âPage Viewâ. Give your event a name such as âOrder Completedâ. -
Add custom parameters to your event
Under the âParametersâ section, click on âAdd Custom Parameterâ. Name your parameter âShipping Feeâ and set its value to the shipping fee of the order. You can retrieve the shipping fee value from the Shopify order object using Shopifyâs Liquid code. -
Add the event to your order confirmation page
In your Shopify store, go to âThemesâ and select âEdit Codeâ for the theme youâre using. Find the template that corresponds to your order confirmation page (typically named âorder-confirmation.liquidâ) and add the GA4 event code with the custom parameters you just created.
Below is an example of the GA4 event code with the custom parameter.
gtag(âeventâ, âorder_completedâ, {
âShipping Feeâ: {{ order.shipping_price | money_without_currency }}
});
This code will fire the âOrder Completedâ event and include the shipping fee value as the custom parameter âShipping Feeâ.
Once youâve set up the custom event, you should start seeing the shipping fee data in your GA4 reports. Keep in mind that it may take some time for the data to populate in your reports, so be patient and allow a few days for the data to appear.
Gina
Hi Gina,
Iâm experiencing the same issue but couldnât find the order finalization page in our theme. I asked the developer of our theme (Focus theme) and they said that Shopify controls that page and it cannot be edited. Weâre using the Basic plan; is this answer only applicable to Plus users?
Hi Gina,
Do you know if this is for Plus users only? Our theme doesnât have a thank you page in its theme files and were told by the developer we cannot edit the page.
Thanks,
Ryan
I am having the same issue, With some of my transactions being double counted too, Iâm using the recommended integration through the Google Shopping Channel
In the basic version you can find this in the checkout settings under âaddition fields to addâ
Here you can run scripts that load on the thank-you page, even if you do not have access to the theme files (that are only available on plus).