@likecoin/nuxt-gre-pixel-module
v0.0.1
Published
A nuxt module for integrating event pixel for Vertex AI Search for retail
Downloads
58
Readme
nuxt-gre-pixel-module
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.
Setup
- 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.
Usage
Set visitor ID (Required)
this.$gre.setVisitorId("visitor-id");
Set user ID (Optional)
this.$gre.setUserId("user-id");
Record event
this.$gre.logEvent("search", {
searchQuery: "search this",
pageCategories: ["category > subcategory"],
productDetails: [
{
product: { id: "item-id" },
quantity: 1,
},
],
});
Development
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
npm run dev
License
Copyright (c) William Chong [email protected]