Skip to content

Commit

Permalink
EventsSDK: Replace sites with pages (#126)
Browse files Browse the repository at this point in the history
Replace usages of `sites` in EventPayload(s) with `pages`

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

---------

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 Jan 31, 2024
1 parent 4286541 commit 5e17527
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/analytics.eventpayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ 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 | _(Optional)_ The locale of the user who generated the event. |
| [location?](./analytics.eventpayload.location.md) | | Coordinates \| string | _(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. |
| [pages?](./analytics.eventpayload.pages.md) | | { siteUid?: number; template?: string; } | _(Optional)_ Fields specific to reporting Yext Pages Analytics Events |
| [pageUrl?](./analytics.eventpayload.pageurl.md) | | string | _(Optional)_ The URL of the page where the event occurred |
| [referrerUrl?](./analytics.eventpayload.referrerurl.md) | | string | _(Optional)_ The URL of the page which the visitor came from prior to the event. |
| [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 |
| [searchTerm?](./analytics.eventpayload.searchterm.md) | | string | _(Optional)_ |
| [sessionId?](./analytics.eventpayload.sessionid.md) | | string \| null | _(Optional)_ Unique identifier to tie together events in a single browsing session |
| [sites?](./analytics.eventpayload.sites.md) | | { siteUid?: number; template?: string; } | _(Optional)_ Fields specific to reporting Yext Pages Analytics Events |
| [timestamp?](./analytics.eventpayload.timestamp.md) | | Date \| string | _(Optional)_ The timestamp at which the event occurred, in ISO format. |
| [value?](./analytics.eventpayload.value.md) | | { amount: number; currency: string; } | _(Optional)_ The monetary value of the event. |
| [visitor?](./analytics.eventpayload.visitor.md) | | Record&lt;string, string&gt; | _(Optional)_ Information used to associate analytics with a particular user. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/analytics](./analytics.md) &gt; [EventPayload](./analytics.eventpayload.md) &gt; [sites](./analytics.eventpayload.sites.md)
[Home](./index.md) &gt; [@yext/analytics](./analytics.md) &gt; [EventPayload](./analytics.eventpayload.md) &gt; [pages](./analytics.eventpayload.pages.md)

## EventPayload.sites property
## EventPayload.pages property

Fields specific to reporting Yext Pages Analytics Events

**Signature:**

```typescript
sites?: {
pages?: {
siteUid?: number;
template?: string;
};
Expand Down
8 changes: 4 additions & 4 deletions etc/analytics.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export interface EventPayload {
locale?: string;
// Warning: (ae-forgotten-export) The symbol "Coordinates" needs to be exported by the entry point index.d.ts
location?: Coordinates | string;
pages?: {
siteUid?: number;
template?: string;
};
pageUrl?: string;
referrerUrl?: string;
search?: {
Expand All @@ -87,10 +91,6 @@ export interface EventPayload {
// (undocumented)
searchTerm?: string;
sessionId?: string | null;
sites?: {
siteUid?: number;
template?: string;
};
timestamp?: Date | string;
value?: {
amount: number;
Expand Down
2 changes: 1 addition & 1 deletion src/EventPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface EventPayload {
/** Unique identifier to tie together events in a single browsing session */
sessionId?: string | null;
/** Fields specific to reporting Yext Pages Analytics Events */
sites?: {
pages?: {
/* 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
2 changes: 1 addition & 1 deletion test-cdn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
analyticsProvider.report({
action: 'WEBSITE',
chat: null,
sites: {
pages: {
siteUid: 123456789,
template: 'test-template'
}
Expand Down
2 changes: 1 addition & 1 deletion test-site/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function firePagesEvent() {
analyticsProvider.report({
action: 'WEBSITE',
chat: null,
sites: {
pages: {
siteUid: 123456789,
template: 'test-template'
}
Expand Down
4 changes: 2 additions & 2 deletions tests/convertStringToValue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('convertTypesGTM Test', () => {
search: {
versionNumber: '5'
},
sites: {
pages: {
siteUid: '5'
}
};
Expand All @@ -21,7 +21,7 @@ describe('convertTypesGTM Test', () => {
search: {
versionNumber: 5
},
sites: {
pages: {
siteUid: 5
}
});
Expand Down

0 comments on commit 5e17527

Please sign in to comment.