Skip to content

A nuxt 2 module for integrating event pixel for Google Cloud's Vertex AI Search for retail

License

Notifications You must be signed in to change notification settings

likecoin/nuxt-gre-pixel-module

 
 

Repository files navigation

nuxt-gre-pixel-module

npm version npm downloads Github Actions CI Codecov License

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.

📖 Release Notes

Setup

  1. Add nuxt-gre-pixel-module dependency to your project
yarn add nuxt-gre-pixel-module # or npm install nuxt-gre-pixel-module
  1. Add nuxt-gre-pixel-module to the modules section of nuxt.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

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) William Chong [email protected]

About

A nuxt 2 module for integrating event pixel for Google Cloud's Vertex AI Search for retail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.0%
  • Vue 2.0%