Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions dist/Cortex-Kit.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ EventHandler.prototype.logPageView = function(event) {
EventAttributes: {hostname: "www.google.com", title: 'Test Page'}, // These are event attributes only if no additional event attributes are explicitly provided to mParticle.logPageView(...)
}
*/
if (!this.common.forwardWebRequestsServerSide) {
vidora.push(["send", "pageview", null, {params: event.EventAttributes}]);
return true;
}
return false
};

var eventHandler = EventHandler;
Expand Down Expand Up @@ -178,13 +183,19 @@ var initialization = {
*/
initForwarder: function(forwarderSettings, testMode, userAttributes, userIdentities, processEvent, eventQueue, isInitialized, common, appVersion, appName, customFlags, clientId) {
/* `forwarderSettings` contains your SDK specific settings such as apiKey that your customer needs in order to initialize your SDK properly */
var clientScript = document.createElement('script');
clientScript.type = 'text/javascript';
clientScript.async = true;
clientScript.src = 'https://assets.vidora.com/js/vidora-client.1.x.x.min.js'; // <---- Update this to be your script
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript);
clientScript.onload = function(n,_,i,u,a){var r={_q:[]};r.ready=r.push=function(n){r._q.push(n);};var E="vidora_ns";E in n||(n[E]=[]),n[E].push(i),i in n||(n[i]=r),n[i].ready(function(n,_){_._i(u,i,a);});}
(window,document,"vidora",forwarderSettings.apiKey);
common.forwardWebRequestsServerSide = forwarderSettings.forwardWebRequestsServerSide === 'True';
if (!testMode) {
/* Load your Web SDK here using a variant of your snippet from your readme that your customers would generally put into their <head> tags
Generally, our integrations create script tags and append them to the <head>. Please follow the following format as a guide:
*/
var clientScript = document.createElement('script');
clientScript.type = 'text/javascript';
clientScript.async = true;
clientScript.src = 'https://assets.vidora.com/js/vidora-client.1.x.x.min.js'; // <---- Update this to be your script
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript);
clientScript.onload = function(n,_,i,u,a){var r={_q:[]};r.ready=r.push=function(n){r._q.push(n);};var E="vidora_ns";E in n||(n[E]=[]),n[E].push(i),i in n||(n[i]=r),n[i].ready(function(n,_){_._i(u,i,a);});}
(window,document,"vidora",forwarderSettings.apiKey);
}
}
};

Expand Down
25 changes: 18 additions & 7 deletions dist/Cortex-Kit.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ var CortexKit = (function (exports) {
EventAttributes: {hostname: "www.google.com", title: 'Test Page'}, // These are event attributes only if no additional event attributes are explicitly provided to mParticle.logPageView(...)
}
*/
if (!this.common.forwardWebRequestsServerSide) {
vidora.push(["send", "pageview", null, {params: event.EventAttributes}]);
return true;
}
return false
};

var eventHandler = EventHandler;
Expand Down Expand Up @@ -177,13 +182,19 @@ var CortexKit = (function (exports) {
*/
initForwarder: function(forwarderSettings, testMode, userAttributes, userIdentities, processEvent, eventQueue, isInitialized, common, appVersion, appName, customFlags, clientId) {
/* `forwarderSettings` contains your SDK specific settings such as apiKey that your customer needs in order to initialize your SDK properly */
var clientScript = document.createElement('script');
clientScript.type = 'text/javascript';
clientScript.async = true;
clientScript.src = 'https://assets.vidora.com/js/vidora-client.1.x.x.min.js'; // <---- Update this to be your script
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript);
clientScript.onload = function(n,_,i,u,a){var r={_q:[]};r.ready=r.push=function(n){r._q.push(n);};var E="vidora_ns";E in n||(n[E]=[]),n[E].push(i),i in n||(n[i]=r),n[i].ready(function(n,_){_._i(u,i,a);});}
(window,document,"vidora",forwarderSettings.apiKey);
common.forwardWebRequestsServerSide = forwarderSettings.forwardWebRequestsServerSide === 'True';
if (!testMode) {
/* Load your Web SDK here using a variant of your snippet from your readme that your customers would generally put into their <head> tags
Generally, our integrations create script tags and append them to the <head>. Please follow the following format as a guide:
*/
var clientScript = document.createElement('script');
clientScript.type = 'text/javascript';
clientScript.async = true;
clientScript.src = 'https://assets.vidora.com/js/vidora-client.1.x.x.min.js'; // <---- Update this to be your script
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript);
clientScript.onload = function(n,_,i,u,a){var r={_q:[]};r.ready=r.push=function(n){r._q.push(n);};var E="vidora_ns";E in n||(n[E]=[]),n[E].push(i),i in n||(n[i]=r),n[i].ready(function(n,_){_._i(u,i,a);});}
(window,document,"vidora",forwarderSettings.apiKey);
}
}
};

Expand Down
5 changes: 5 additions & 0 deletions src/event-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ EventHandler.prototype.logPageView = function(event) {
EventAttributes: {hostname: "www.google.com", title: 'Test Page'}, // These are event attributes only if no additional event attributes are explicitly provided to mParticle.logPageView(...)
}
*/
if (!this.common.forwardWebRequestsServerSide) {
vidora.push(["send", "pageview", null, {params: event.EventAttributes}]);
return true;
}
return false
};

module.exports = EventHandler;
16 changes: 8 additions & 8 deletions src/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ var initialization = {
*/
initForwarder: function(forwarderSettings, testMode, userAttributes, userIdentities, processEvent, eventQueue, isInitialized, common, appVersion, appName, customFlags, clientId) {
/* `forwarderSettings` contains your SDK specific settings such as apiKey that your customer needs in order to initialize your SDK properly */
var clientScript = document.createElement('script');
clientScript.type = 'text/javascript';
clientScript.async = true;
clientScript.src = 'https://assets.vidora.com/js/vidora-client.1.x.x.min.js'; // <---- Update this to be your script
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript);
clientScript.onload = function(n,_,i,u,a){var r={_q:[]};r.ready=r.push=function(n){r._q.push(n)};var E="vidora_ns";E in n||(n[E]=[]),n[E].push(i),i in n||(n[i]=r),n[i].ready(function(n,_){_._i(u,i,a)})}
(window,document,"vidora",forwarderSettings.apiKey);

common.forwardWebRequestsServerSide = forwarderSettings.forwardWebRequestsServerSide === 'True'
if (!testMode) {
/* Load your Web SDK here using a variant of your snippet from your readme that your customers would generally put into their <head> tags
Generally, our integrations create script tags and append them to the <head>. Please follow the following format as a guide:
*/
var clientScript = document.createElement('script');
clientScript.type = 'text/javascript';
clientScript.async = true;
clientScript.src = 'https://assets.vidora.com/js/vidora-client.1.x.x.min.js'; // <---- Update this to be your script
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(clientScript);
clientScript.onload = function(n,_,i,u,a){var r={_q:[]};r.ready=r.push=function(n){r._q.push(n)};var E="vidora_ns";E in n||(n[E]=[]),n[E].push(i),i in n||(n[i]=r),n[i].ready(function(n,_){_._i(u,i,a)})}
(window,document,"vidora",forwarderSettings.apiKey);
} else {
// For testing, you should fill out this section in order to ensure any required initialization calls are made,
// clientSDKObject.initialize(forwarderSettings.apiKey)
Expand Down