This package is deprecated. To integrate a third party script with your Nuxt project, follow our docs here: https://docs.getnacelle.com/nuxt/external-scripts.html
Integrate Littledata in your Nacelle Nuxt Starter project
This plugin makes it easier to add the Google Analytics client ID to checkout attributes, as documented in step 4 of Littledata's headless setup guide.
- A Nacelle project set up locally.
- Google Analytics set up in the Nacelle Nuxt Starter.
- Littledata set up.
Once you have Nacelle, Google Analytics and Littledata set up you can install this module in your project from npm
:
npm install @nacelle/nacelle-littledata-nuxt-module --save
In nuxt.config.js
, add @nacelle/nacelle-littledata-nuxt-module
to the modules
array:
modules: [
// ...other modules,
'@nacelle/nacelle-littledata-nuxt-module'
],
Finally, use the $getLittledataMetafield
function to add the Google Analytics client ID to $nacelle.checkout.process
:
const processCheckoutObject = await this.$nacelle.checkout.process({
cartItems: getters.checkoutLineItems,
checkoutId: getters.checkoutIdForBackend,
metafields: [await this.$getLittledataMetafield()],
});