Skip to content

Commit

Permalink
add tracker name
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed May 1, 2020
1 parent 6e27cad commit b6cdd53
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions integrations/GA/browser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logger from "../../utils/logUtil";
class GA {
constructor(config) {
this.trackingID = config.trackingID; //UA-149602794-1
this.trackingID = config.trackingID;
this.name = "GA";
}

Expand All @@ -28,14 +28,14 @@ class GA {

//window.ga_debug = {trace: true};

ga("create", this.trackingID, "auto");
ga("send", "pageview");
ga("create", this.trackingID, "auto", "rudder_ga");
//ga("send", "pageview");

logger.debug("===in init GA===");
}

identify(rudderElement) {
ga("set", "userId", rudderElement.message.anonymous_id);
ga("rudder_ga.set", "userId", rudderElement.message.anonymous_id);
logger.debug("in GoogleAnalyticsManager identify");
}

Expand Down Expand Up @@ -63,7 +63,7 @@ class GA {
eventLabel: eventLabel,
eventValue: eventValue
};
ga("send", "event", payLoad);
ga("rudder_ga.send", "event", payLoad);
logger.debug("in GoogleAnalyticsManager track");
}

Expand All @@ -81,18 +81,19 @@ class GA {
: undefined;

if (path) {
ga("set", "page", path);
ga("rudder_ga.set", "page", path);
}

if (title) {
ga("set", "title", title);
ga("rudder_ga.set", "title", title);
}

if (location) {
ga("set", "location", location);
ga("rudder_ga.set", "location", location);
}

ga("send", "pageview");
ga("rudder_ga.send", "pageview");

}

isLoaded() {
Expand Down

0 comments on commit b6cdd53

Please sign in to comment.