Skip to content

Commit

Permalink
Merge pull request #91 from kaltura/SUP-46750
Browse files Browse the repository at this point in the history
fix(SUP-46750):(Salesforce+) GDPR on embeds for Path
  • Loading branch information
MosheMaorKaltura authored Feb 13, 2025
2 parents 463e216 + 6b45cc6 commit c73f1d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
20 changes: 12 additions & 8 deletions src/google-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ export default class GoogleAnalytics extends BasePlugin {
*/
constructor(name: string, player: Player, config: Object) {
super(name, player, config);
if (this.config.trackingId || this.config.trackingGA4Id) {
this._init();
this._addBindings();
this._sendEvent({
action: WIDGET_LOADED_ACTION,
category: this._getValue(this.config.tracking.category)
});
if (document.cookie) {
if (this.config.trackingId || this.config.trackingGA4Id) {
this._init();
this._addBindings();
this._sendEvent({
action: WIDGET_LOADED_ACTION,
category: this._getValue(this.config.tracking.category)
});
} else {
this.logger.warn('No Google Analytics tracking ID provided. Tracking aborted');
}
} else {
this.logger.warn('No Google Analytics tracking ID provided. Tracking aborted');
this.logger.warn('No cookies enabled. Tracking aborted');
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/src/google-analytics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const targetId = 'player-placeholder_google-analytics.spec';

describe('Google Analytics Plugin', function () {
let player;
const id = '1_rwbj3j0a';
const partnerId = 1068292;
const id = '0_fnkamt8x';
const partnerId = 243342;
const uiConfId = 123456;
const entryName = 'some name';

const CMid = '1_fdsfds78';
const CMpartnerId = 876543;
const CMid = '0_uka1msg4';
const CMpartnerId = 243342;
const CMuiConfId = 654321;
const CMentryName = 'change media name';

Expand Down

0 comments on commit c73f1d2

Please sign in to comment.