Skip to content

Commit

Permalink
EventsSDK: Add originalEventName to EventPayload (#138)
Browse files Browse the repository at this point in the history
Add originalEventName to EventPayload to support Pages. 

[J=FUS-6279](https://yexttest.atlassian.net/browse/FUS-6279)
R=abenno, mtian
TEST=manual

Tried passing pages object with originalEventName value into test site
and confirmed no compile time errors.

---------

Co-authored-by: Ethan Jaffee <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 28, 2024
1 parent 4ad0921 commit 91095d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/analytics.eventpayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface EventPayload
| [label?](./analytics.eventpayload.label.md) | | string | _(Optional)_ A label assigned to the event, e.g. a CTA label. |
| [locale?](./analytics.eventpayload.locale.md) | | string | <p>_(Optional)_ The locale of the user who generated the event.</p><p>If not specified the system will automatically determine the locale from the autogenerated Accept-Language header.</p> |
| [location?](./analytics.eventpayload.location.md) | | Coordinates \| string | <p>_(Optional)_ The location information of the visitor for the event. Either a Coordinates object with both latitude and longitude or a string with the country of the visitor for the event, as a ISO 3166-1 alpha-2 country code. For more information see https://www.iso.org/iso-3166-country-codes.html.</p><p>If not specified the system will automatically determine all location information from the request's IP address, or the value of the <code>ip</code> property if specified.</p> |
| [pages?](./analytics.eventpayload.pages.md) | | { scope?: string; siteUid?: number; template?: string; } | _(Optional)_ Fields specific to reporting Yext Pages Analytics Events |
| [pages?](./analytics.eventpayload.pages.md) | | { scope?: string; originalEventName?: string; siteUid?: number; template?: string; } | _(Optional)_ Fields specific to reporting Yext Pages Analytics Events |
| [pageUrl?](./analytics.eventpayload.pageurl.md) | | string | <p>_(Optional)_ The URL of the page where the event occurred.</p><p>If not specified the system will automatically use the <code>Referrer</code> header from the autogenerated request headers.</p> |
| [referrerUrl?](./analytics.eventpayload.referrerurl.md) | | string | <p>_(Optional)_ The URL of the page which the visitor came from prior to the event.</p><p>If not specified the system will automatically use the <code>Referrer</code> header from the autogenerated request headers.</p> |
| [search?](./analytics.eventpayload.search.md) | | { searchId?: string; queryId?: string; verticalKey?: string; isDirectAnswer?: boolean; versionLabel?: [VersionLabel](./analytics.versionlabel.md)<!-- -->; versionNumber?: number; experienceKey: string; } | _(Optional)_ Fields specific to reporting Yext Search Analytics Events |
Expand Down
1 change: 1 addition & 0 deletions docs/analytics.eventpayload.pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Fields specific to reporting Yext Pages Analytics Events
```typescript
pages?: {
scope?: string;
originalEventName?: string;
siteUid?: number;
template?: string;
};
Expand Down
1 change: 1 addition & 0 deletions etc/analytics.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface EventPayload {
location?: Coordinates | string;
pages?: {
scope?: string;
originalEventName?: string;
siteUid?: number;
template?: string;
};
Expand Down
2 changes: 2 additions & 0 deletions src/EventPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export interface EventPayload {
pages?: {
/** The scope of an action. Applies to Pages events. */
scope?: string;
/** The Event name as it was used in previous analytics implementations. */
originalEventName?: string;
/* The UID of the site an event was tied to. */
siteUid?: number;
/* The ID of the template from which a site was generated. */
Expand Down

0 comments on commit 91095d7

Please sign in to comment.