Skip to content

Commit

Permalink
changed return avlue for isloaded and isready
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchiramoitra authored and sayan-mitra committed Sep 16, 2020
1 parent ac32b2d commit 88edb0f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions integrations/TVSquared/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TVSquared {
url += `collector-${this.clientId}.tvsquared.com/`;
window._tvq.push(["setSiteId", this.brandId]);
window._tvq.push(["setTrackerUrl", `&${url}tv2track.php`]);
ScriptLoader("TVSquared-integration", `${url}tv2track.js`);
//ScriptLoader("TVSquared-integration", `${url}tv2track.js`);

window._tvq.push([
() => {
Expand All @@ -30,13 +30,12 @@ class TVSquared {

isLoaded = () => {
logger.debug("in TVSqaured isLoaded");
return !!window._tvq;
return !!(window._tvq && window._tvq.push !== Array.prototype.push);
};

isReady = () => {
logger.debug("in TVSqaured isReady");

return !!window._tvq;
return !!(window._tvq && window._tvq.push !== Array.prototype.push);
};

page = () => {
Expand Down Expand Up @@ -87,6 +86,8 @@ class TVSquared {
}
}
}
console.log(session);
console.log(action);
window._tvq.push([
() => {
this.setCustomVariable(5, "session", JSON.stringify(session), "visit");
Expand Down

0 comments on commit 88edb0f

Please sign in to comment.