A nuxt module for integrating event pixel for Vertex AI Search for retail
Please refer to the official documentation for more information on how to use the retail event pixel.
- Add
nuxt-gre-pixel-module
dependency to your project
yarn add nuxt-gre-pixel-module # or npm install nuxt-gre-pixel-module
- Add
nuxt-gre-pixel-module
to themodules
section ofnuxt.config.js
{
modules: [
// Simple usage
"nuxt-gre-pixel-module",
// With options
[
"nuxt-gre-pixel-module",
{
/* module options */
apiKey: "your-google-cloud-api-credentials-key",
projectId: "your-google-cloud-project-id",
locationId: "global",
catalogId: "default_catalog",
debug: false,
},
],
];
}
Please refer to the official documentation on how to obtain the apiKey
for retail event pixel.
this.$gre.setVisitorId("visitor-id");
this.$gre.setUserId("user-id");
this.$gre.logEvent("search", {
searchQuery: "search this",
pageCategories: ["category > subcategory"],
productDetails: [
{
product: { id: "item-id" },
quantity: 1,
},
],
});
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
npm run dev
Copyright (c) William Chong [email protected]