Skip to content

Commit

Permalink
feat: update logEvent to track
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip committed Aug 1, 2023
1 parent 931a766 commit 74a5710
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/integrations/Amplitude/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/* eslint-disable no-underscore-dangle */
/* eslint-disable class-methods-use-this */
import Logger from '../../utils/logger';
import { type } from '../../utils/utils';
import { NAME } from './constants';

import { loader } from './loader';
Expand Down Expand Up @@ -191,7 +190,7 @@ class Amplitude {
logEventAndCorrespondingRevenue(rudderMessage, dontTrackRevenue) {
const { properties, event } = rudderMessage;

window.amplitude.logEvent(event, properties);
window.amplitude.track(event, properties);
if (properties.revenue && !dontTrackRevenue) {
this.trackRevenue(rudderMessage);
}
Expand All @@ -213,23 +212,23 @@ class Amplitude {
// all pages
if (this.trackAllPages) {
const event = 'Loaded a page';
window.amplitude.logEvent(event, properties);
window.amplitude.track(event, properties);
}

// categorized pages
if (category && this.trackCategorizedPages) {
let event;
if (!useNewPageEventNameFormat) event = `Viewed page ${category}`;
else event = `Viewed ${category} Page`;
window.amplitude.logEvent(event, properties);
window.amplitude.track(event, properties);
}

// named pages
if (name && this.trackNamedPages) {
let event;
if (!useNewPageEventNameFormat) event = `Viewed page ${name}`;
else event = `Viewed ${name} Page`;
window.amplitude.logEvent(event, properties);
window.amplitude.track(event, properties);
}
}

Expand Down

0 comments on commit 74a5710

Please sign in to comment.