@nacelle/nacelle-littledata-nuxt-moduledeprecated

Integrates Littledata into your Nacelle Nuxt project

Usage no npm install needed!

<script type="module">
  import nacelleNacelleLittledataNuxtModule from 'https://cdn.skypack.dev/@nacelle/nacelle-littledata-nuxt-module';
</script>

README

[DEPRECATED]

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

Nacelle Littledata Nuxt Module

Integrate Littledata in your Nacelle Nuxt Starter project

nacelle-littledata-nuxt-module

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.

Prerequisites

Add Module to Nacelle

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()],
});