Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterPhilip committed Apr 9, 2020
2 parents 537869f + 6968426 commit 9360783
Show file tree
Hide file tree
Showing 26 changed files with 1,500 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function (grunt) {
},
"production": {
"name": "Omnibug",
"version": "1.14.0",
"version": "1.15.0",
"storageKey": "omnibug",
"feedbackUrl": "https://github.com/MisterPhilip/omnibug/issues",
"analyticsID": "UA-114343677-2"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omnibug",
"version": "1.14.0",
"version": "1.15.0",
"description": "Omnibug Extension",
"main": "Gruntfile.js",
"scripts": {
Expand Down
Binary file added src/assets/images/icons/BINGADS16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/icons/CRITEOONETAG16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/icons/LINKEDINPIXEL16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/icons/PINTEREST16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/icons/SNAPCHAT16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/icons/TWITTERPIXEL16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions src/assets/styles/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@ $icons: (
"Adobe Heartbeat": $iconPath + "ADOBEHEARTBEAT16x16.png",
"Adobe Launch": $iconPath + "ADOBELAUNCH16x16.png",
"Adobe Target": $iconPath + "ADOBETARGET16x16.png",
"AT Internet": $iconPath + "ATINTERNET16x16.png",
"Bing Ads": $iconPath + "BINGADS16x16.png",
"Comscore": $iconPath + "COMSCORE16x16.png",
"Criteo OneTag": $iconPath + "CRITEOONETAG16x16.png",
"Ensighten Manage": $iconPath + "ENSIGHTEN16x16.png",
"Facebook Pixel": $iconPath + "FACEBOOK16x16.png",
"Google Ads": $iconPath + "GOOGLEADS16x16.png",
"Google DoubleClick": $iconPath + "DOUBLECLICK16x16.png",
"Google Tag Manager": $iconPath + "GOOGLETAGMANAGER16x16.png",
"LinkedIn Conversion": $iconPath + "LINKEDINPIXEL16x16.png",
"Matomo": $iconPath + "MATOMO16x16.png",
"Mparticle": $iconPath + "MPARTICLE16x16.png",
"Optimizely X": $iconPath + "OPTIMIZELY16x16.png",
"Pinterest Conversion": $iconPath + "PINTEREST16x16.png",
"Piwik PRO": $iconPath + "PIWIKPRO16x16.png",
"Piwik PRO Tag Manager": $iconPath + "PIWIKPRO16x16.png",
"Segment": $iconPath + "SEGMENT16x16.png",
"Snapchat": $iconPath + "SNAPCHAT16x16.png",
"Tealium IQ": $iconPath + "TEALIUM16x16.png",
"Universal Analytics": $iconPath + "GOOGLEANALYTICS16x16.png",
"AT Internet": $iconPath + "ATINTERNET16x16.png"
"Twitter Conversion": $iconPath + "TWITTERPIXEL16x16.png",
"Universal Analytics": $iconPath + "GOOGLEANALYTICS16x16.png"
);

@mixin iconRule($title, $path) {
Expand Down
10 changes: 5 additions & 5 deletions src/devtools/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,11 @@ window.Omnibug = (() => {
* @param newSettings
* @param fromStorage
*/
function loadSettings(newSettings, fromStorage = false) {
function loadSettings(newSettings = {}, fromStorage = false) {
let styleSheet = d.getElementById("settingsStyles"),
defaults = (new OmnibugSettings).defaults;

settings = newSettings;
settings = Object.assign(defaults, newSettings);

let theme = settings.theme,
themeType = settings.theme === "auto" ? "auto" : "manual";
Expand Down Expand Up @@ -912,7 +912,7 @@ window.Omnibug = (() => {
}

// Build any default filters
if (!storageLoadedSettings && fromStorage) {
if (!storageLoadedSettings && fromStorage && typeof settings.defaultFilters === "object" && settings.defaultFilters !== null) {
if (Object.entries(settings.defaultFilters).length) {
filters = filters || {};
if (settings.defaultFilters.fields) {
Expand Down Expand Up @@ -969,8 +969,8 @@ window.Omnibug = (() => {

// Wrap text or truncate with ellipsis
if (!settings.wrapText) {
styleSheet.sheet.insertRule(`.parameter-value > span {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}`, styleSheet.sheet.cssRules.length);
styleSheet.sheet.insertRule(`.parameter-value > span:hover {white-space: normal; overflow: visible; height:auto;}`, styleSheet.sheet.cssRules.length);
styleSheet.sheet.insertRule(`.parameter-value > span {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;}`, styleSheet.sheet.cssRules.length);
styleSheet.sheet.insertRule(`tr:hover .parameter-value > span {white-space: normal; overflow: visible; height:auto;}`, styleSheet.sheet.cssRules.length);
}

// Hide note field if disabled
Expand Down
1 change: 1 addition & 0 deletions src/devtools/panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ nav.navbar {
}
.parameter-value {
padding-left: 5px;
padding-right: 5px;
}
}
.request-details:last-of-type {
Expand Down
145 changes: 145 additions & 0 deletions src/providers/BingAds.js
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;
}
}
132 changes: 132 additions & 0 deletions src/providers/CriteoOneTag.js
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;
}
}
2 changes: 1 addition & 1 deletion src/providers/GoogleAds.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GoogleAdsProvider extends BaseProvider {
constructor() {
super();
this._key = "GOOGLEADS";
this._pattern = /googleads\.g\.doubleclick\.net\/pagead\//;
this._pattern = /googleads\.g\.doubleclick\.net\/pagead\/(?:viewthrough)conversion/;
this._name = "Google Ads";
this._type = "marketing";
this._keywords = ["aw", "ad words"];
Expand Down
Loading

0 comments on commit 9360783

Please sign in to comment.