Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrishac committed Jul 5, 2020
1 parent 5d2e0ad commit 3e62368
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils/autotrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function isTextNode(el) {
return el && el.nodeType === 3; // Node.TEXT_NODE - use integer constant for browser portability
}

// excerpt from https://github.com/mixpanel/mixpanel-js/blob/master/src/autotrack-utils.js
function shouldTrackElement(el) {

if (!el.parentNode || isTag(el, "body")) return false;
Expand Down Expand Up @@ -238,6 +239,7 @@ function isExplicitNoTrack(el){
return false;
}

// excerpt from https://github.com/mixpanel/mixpanel-js/blob/master/src/autotrack-utils.js
function isValueToBeTracked(value){
if(value === null || value === undefined){
return false;
Expand Down Expand Up @@ -274,6 +276,12 @@ function isValueToBeTracked(value){
return true;
}

// if the element name is provided in the valTrackingList while loading rudderanalytics, track the value.
/**
*
* @param {*} el
* @param {*} includeList - valTrackingList provided in rudderanalytics.load()
*/
function isValueToBeTrackedFromTrackingList(el, includeList) {
const elAttributesLength = el.attributes.length;
for (let i = 0; i < elAttributesLength; i++) {
Expand Down

0 comments on commit 3e62368

Please sign in to comment.