Tracking purchases in GA4 via the browser

Updated on 2024-03-21

Littledata's server-side tracking encounters certain constraints because it relies on Measurement Protocol.
Google's Measurement Protocol restricts the tracking of specific data, which directly impacts geographic and demographic reporting, as well as the reporting on device types and operating systems.

This means that purchases cannot be split by country or device category without a workaround.

note:

By using this client-side workaround, you may experience up to 2% missing purchases in Google Analytics due to the nature of the implementation (e.g. the order identifier couldn't be accessed on the thank you page).

To remove this limitation, Littledata is now tracking some conversions from the thank you page (client-side tracking). 

How to enable client-side purchase?

Access your Littledata app and go to the Google Analytics 4 connection settings. In the Data customisation tab you will find the Client-side purchase setting. Turn it on and save the settings. 🎉

How does it work?

Let’s consider two scenarios:

  1. The purchase is not sent from the browser, as the user’s browser has an adblocker. Littledata will send the purchase server-side, as before.
  2. The purchase event is sent from the browser. Littledata’s servers will not send the purchase event, but instead add a server-side ld_customer_data event with all the user parameters normally added by our servers.
note:

Recurring orders, upsells, draft orders, POS orders will always be sent server-side.

Limitations

  • Transaction ID will always be the Shopify Order ID (4704500646021) this is required for proper deduplication because it is the only consistent format present both client and server-side (when this feature is turned on, the order identifier setting will be automatically changed to the Shopify Order ID).

shopify-order-id-in-url

  • Affiliation parameter will not be included in the event payload sent from the client-side as order tags are not accessible on the storefront.
note:

Due to the enhancements brought by this feature, you may experience up to 2% missing transactions reported in Google Analytics.