-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,500 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/** | ||
* Bing Ads UET | ||
* https://about.ads.microsoft.com/en-us/solutions/audience-targeting/universal-event-tracking | ||
* | ||
* @class | ||
* @extends BaseProvider | ||
*/ | ||
class BingAdsProvider extends BaseProvider { | ||
constructor() { | ||
super(); | ||
this._key = "BINGUET"; | ||
this._pattern = /bat\.bing\.com\/action/; | ||
this._name = "Bing Ads"; | ||
this._type = "marketing"; | ||
this._keywords = ["UET", "uetq", "Microsoft", "MSN", "atdmt", "bat.js"]; | ||
} | ||
|
||
/** | ||
* Retrieve the column mappings for default columns (account, event type) | ||
* | ||
* @return {{}} | ||
*/ | ||
get columnMapping() { | ||
return { | ||
"account": "ti", | ||
"requestType": "requestType" | ||
}; | ||
} | ||
|
||
/** | ||
* Retrieve the group names & order | ||
* | ||
* @returns {*[]} | ||
*/ | ||
get groups() { | ||
return [ | ||
{ | ||
"key": "general", | ||
"name": "General" | ||
}, | ||
{ | ||
"key": "events", | ||
"name": "Events" | ||
} | ||
]; | ||
} | ||
|
||
/** | ||
* Get all of the available URL parameter keys | ||
* | ||
* @returns {{}} | ||
*/ | ||
get keys() { | ||
return { | ||
"ti": { | ||
"name": "Tag ID", | ||
"group": "general" | ||
}, | ||
"ec": { | ||
"name": "Event Category", | ||
"group": "events" | ||
}, | ||
"ea": { | ||
"name": "Event Action", | ||
"group": "events" | ||
}, | ||
"el": { | ||
"name": "Event Label", | ||
"group": "events" | ||
}, | ||
"ev": { | ||
"name": "Event Value", | ||
"group": "events" | ||
}, | ||
"gv": { | ||
"name": "Goal Revenue", | ||
"group": "events" | ||
}, | ||
"prodid": { | ||
"name": "Product ID", | ||
"group": "events" | ||
}, | ||
"pagetype": { | ||
"name": "Page Type", | ||
"group": "general" | ||
}, | ||
"evt": { | ||
"name": "Event Type", | ||
"group": "general" | ||
}, | ||
"spa": { | ||
"name": "Single Page App", | ||
"group": "general" | ||
}, | ||
"page_path": { | ||
"name": "Page Path", | ||
"group": "general" | ||
}, | ||
"p": { | ||
"name": "Page URL", | ||
"group": "general" | ||
}, | ||
"tl": { | ||
"name": "Page Title", | ||
"group": "other" | ||
}, | ||
"kw": { | ||
"name": "Keywords Meta Tag", | ||
"group": "other" | ||
}, | ||
"r": { | ||
"name": "Page Referrer", | ||
"group": "other" | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Parse custom properties for a given URL | ||
* | ||
* @param {string} url | ||
* @param {object} params | ||
* | ||
* @returns {Array} | ||
*/ | ||
handleCustom(url, params) { | ||
let results = [], | ||
event = params.get("evt"), | ||
requestType = "other"; | ||
|
||
if (event === "pageLoad") { | ||
requestType = "Page View"; | ||
} else { | ||
requestType = event.charAt(0).toUpperCase() + event.slice(1); | ||
} | ||
|
||
results.push({ | ||
"key": "requestType", | ||
"value": requestType, | ||
"hidden": true | ||
}); | ||
|
||
return results; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/** | ||
* Criteo OneTag | ||
* https://www.criteo.com/ | ||
* | ||
* @class | ||
* @extends BaseProvider | ||
*/ | ||
|
||
class CriteoOneTagProvider extends BaseProvider { | ||
constructor() { | ||
super(); | ||
this._key = "CRITEOONETAG"; | ||
this._pattern = /sslwidget\.criteo\.com\/event/; | ||
this._name = "Criteo OneTag"; | ||
this._type = "marketing"; | ||
} | ||
|
||
/** | ||
* Retrieve the column mappings for default columns (account, event type) | ||
* | ||
* @return {{}} | ||
*/ | ||
get columnMapping() { | ||
return { | ||
account: "a", | ||
requestType: "requestType" | ||
}; | ||
} | ||
|
||
/** | ||
* Retrieve the group names & order | ||
* | ||
* @returns {*[]} | ||
*/ | ||
get groups() { | ||
return [ | ||
{ | ||
key: "general", | ||
name: "General" | ||
}, | ||
{ | ||
key: "events", | ||
name: "Events" | ||
} | ||
]; | ||
} | ||
|
||
/** | ||
* Get all of the available URL parameter keys | ||
* | ||
* @returns {{}} | ||
*/ | ||
get keys() { | ||
return { | ||
"a": { | ||
"name": "Account ID", | ||
"group": "general" | ||
}, | ||
"v": { | ||
"name": "Tag Version", | ||
"group": "other" | ||
}, | ||
"tld": { | ||
"name": "Top-Level Domain", | ||
"group": "other" | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Parse a given URL parameter into human-readable form | ||
* | ||
* @param {string} name | ||
* @param {string} value | ||
* | ||
* @returns {void|{}} | ||
*/ | ||
handleQueryParam(name, value) { | ||
let result = {}, x = false; | ||
if (x) { | ||
// do nothing | ||
} else { | ||
result = super.handleQueryParam(name, value); | ||
} | ||
return result; | ||
} | ||
|
||
/** | ||
* Parse custom properties for a given URL | ||
* | ||
* @param {string} url | ||
* @param {object} params | ||
* | ||
* @returns {Array} | ||
*/ | ||
handleCustom(url, params) { | ||
let results = [], | ||
requestType = []; | ||
|
||
// Grab the request type - in the future we'll attempt to better parse the actual results | ||
params.forEach((value, key) => { | ||
if (/^p\d+$/.test(key)) { | ||
let values = value.split("&"); | ||
if (/^e=/.test(values[0])) { | ||
let type = this._handleEventName(values[0].split("=")[1]); | ||
if (type) { | ||
requestType.push(type); | ||
} | ||
} | ||
} | ||
}); | ||
|
||
results.push({ | ||
"key": "requestType", | ||
"value": requestType.length ? requestType.join(" | ") : "other", | ||
"hidden": true | ||
}); | ||
|
||
return results; | ||
} | ||
|
||
_handleEventName(name) { | ||
let lookupTable = { | ||
"vh": "Homepage", | ||
"vl": "Search Listing View", | ||
"vp": "Product View", | ||
"vb": "Cart View", | ||
"vc": "Purchase" | ||
}; | ||
return lookupTable[name] ? lookupTable[name] : false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.