Phygrid Developers
Browse Topics
Event Tracking / Phygrid Developers

Event Tracking

Standard Events

Predefined functions and events that are common across different types of apps within the Grid. These standard functions exist so that the same events always have the same payload, so analytics data is consistent across different types of apps, which makes for easier reporting.

When tracking user identity, identifyContact and sendContactMetadata should be used.

Custom Events

any events and parameters based on you needs

Make sure you only invoke function events after Grid Signals is initialized.

detectAge

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().detectAge(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.detectAge(params);
...

Information about the user, returned from computer vision, 3rd party services, or selected by a user in the UI

Note, this method will update the Contact Metadata but it will also log the values for analytics purposes. If CONTACT_METADATA event is used directly, then the value is not logged for reports

Parameters

KeyTypeRequired
ageRangenumberyes
interactionbooleanyes
targetAgenumberyes

detectGender

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().detectGender(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.detectGender(params);
...

Information about the user, returned from computer vision, 3rd party services, or selected by a user in the UI

Note, this method will update the Contact Metadata but it will also log the values for analytics purposes.

If CONTACT_METADATA event is used directly, then the value is not logged for reports

Parameters

KeyTypeRequiredDescription
certaintynumberyesThe certainty of the mood, provided by computer vision
genderstringyesAny of the following: FEMALE, MALE
interactionbooleanyes

If the user provided this value or if it was detected from computer vision

detectMood

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().detectMood(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.detectMood(params);
...

Information about the user, return from computer vision or selected by a user in the UI

Note: this method will update the Contact Metadata but it will also log the values for analytics purposes.

If CONTACT_METADATA event is used directly, then the value is not logged for reports

Parameters

KeyTypeRequiredDescription
certaintynumberyesThe certainty of the mood, provided by computer vision
moodstringyes

Any of the following: ANGRY, DISGUST, FEAR, HAPPY, SAD, SURPRISE, NEUTRAL

identifyContact

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().identifyContact(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.identifyContact(params);
...

Identifying the customer based on a known identifier

Parameters

KeyTypeRequiredDescription
contactTypeSTRINGyesProvide any of PHONE, EMAIL, and CLIENT_ID
contactstringyesEnter the value of contactType
interactionbooleanyesWhether the event was triggered by the user or not

sendCartAdd

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCartAdd(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCartAdd(params);
...

Adding a product to the cart

Parameters

KeyTypeDescriptionRequired
productIdstringProduct primary id used in PIMyes
quantitynumberProduct quantity added into the cartyes

sendCartClear

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCartClear();
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCartClear();
...

Clear the cart

sendCartRemove

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCartRemove(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCartRemove(params);
...

Remove a product from the cart

Parameters

KeyTypeDescriptionRequired
productIdstringProduct primary id used in PIMyes
quantitynumberProduct quantity added into the cartyes

sendCartView

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCartView();
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCartView();
...

View the cart page

sendCategoryView

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCategoryView(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCategoryView(params);
...

Browse a category's page

Parameters

KeyTypeDescriptionRequired
categoryIdstringCategory primary id used in PIMyes

sendCheckout

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCheckout();
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCheckout();
...

Checkout step before payment

sendContactMetadata

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendContactMetadata(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendContactMetadata(params);
...

Identifying the customer based on a known identifier.

Parameters

KeyTypeRequiredDescription
interactionbooleanyesWhether the event was triggered by the user or not
str1stringyes

Provide any of PHONE, EMAIL, and CLIENT_ID

str2stringyes

The value of the str1 field

sendContentView

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendContactMetadata(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendContactMetadata(params);
...

View a generic piece of content, equivalent to a "pageview" in old school web analytics

Parameters

KeyTypeRequired
localizedTitlestringno
titlestringyes
urlstringno

sendFeedback

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendFeedback(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendFeedback(params);
...

Send user's feedback on the experience

Parameters

KeyTypeRequired
feedbackstringyes
rating1 | 2 | 3 | 4 | 5no

sendLookView

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendLookView(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendLookView(params);
...

Viewing a specific fashion look, which is an array of products

Parameters

KeyTypeRequired
lookIdstringyes

sendProductView

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendProductView(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendProductView(params);
...

View a specific product page

Parameters

KeyTypeDescriptionRequired
productIdstringProduct primary id used in PIMyes

sendPurchase

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendPurchase(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendPurchase(params);
...

Payment success

Parameters

KeyTypeRequired
couponstringno
currencyCodestringyes
revenuenumberyes
shippingnumberyes
taxnumberyes
transactionIdstringyes

sendRating

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendRating(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendRating(params);
...

The user's rating of the experience

Parameters

KeyTypeRequired
commentstringyes
interactionDelaynumberno
rating1 | 2 | 3 | 4 | 5yes

sendSearch

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendSearch(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendSearch(params);
...

Searching a product, category, or anything in the app

Parameters

KeyTypeRequired
searchQueryStringstringyes

sendSearchClear

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendSearchClear();
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendSearchClear();
...

Searching a product, category, or anything in the app

sendCustomEvent

React

import { getInstance as gs } from '@ombori/grid-signals-react';
...
gs().sendCustomEvent(params);
...

NodeJS or Javascript

import GridSignals from '@ombori/grid-signals';
...
const gs = new GridSignals();
await gs.init(<init-params>); // Check NodeJS App Integration page for init params reference
await gs.sendCustomEvent(params);
...

Used for tracking custom events outside the standard session event methods. Any parameter can be sent, and you have the availabilty of 5 string and 5 number parameters.

Parameters

KeyTypeDescriptionRequired
eventTypestringEvent type outside the standard event types (Example: TEST_EVENT)yes
interactionbooleanIf the event is triggered by a useryes
productIdstringProduct id related to the eventno
categoryIdstringCategory id related to the eventno
int1numberInteger type field related to the eventno
int2numberInteger type field related to the eventno
int3numberInteger type field related to the eventno
int4numberInteger type field related to the eventno
int5numberInteger type field related to the eventno
str1stringString type field related to the eventno
str2stringString type field related to the eventno
str3stringString type field related to the eventno
str4stringString type field related to the eventno
str5stringString type field related to the eventno

© 2024 · Phygrid. An Ombori company