Journey JS

Journey JS is the javascript code that exists on your site, which allows Strala to capture the touchpoint interactions that happen as people interact with your ads, emails, high value experience pages, landing pages, and other Strala-tagged content.

The Journey JS is what ties Strala Touchpoints to the Strala JourneyStream. It is lightweight, asynchronous, and optimized to eliminate any interference with page loads.

Typically through a tag management system, you will place the following code in the <head></head> of the pages on your site:

<script type="text/javascript">
 
"use strict";!function(){var e=window.journey=window.journey||{};if(e.config)return console.log("Journey loaded");e.initialize=function(e,t){if(!e.config&&!e.path&&!e.key)return console.error('[strala] "options" missing one of "config", "path", or "key"');if(e.config)returnt(e.config);var n=e.path||"https://journey.strala.com/configs/"+e.key+".json",r=newXMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===XMLHttpRequest.DONE){if(!(r.status<300))return console.error(r.statusText);if(!r.responseText)return console.error("[strala] Request failed! No config available to parse.",r);if(t)returnt(JSON.parse(r.responseText))}},r.open("GET",n,!0),r.send()},e.load=function(t){e.config=t;var n=t.version||"current",r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://journey.strala.com/build/journey."+n+".js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)}}();
 
var options ={ key:'<Your Organization ID>'};
 
window.addEventListener('load',function(event){
 
  journey.initialize(options, journey.load);
 
});
 
</script>

Once the Journey JS is on your site, it will only fire when it detects an interaction with a Strala-tagged asset. Otherwise it will sit dormant, waiting for an interaction to appear.

Troubleshooting

To troubleshoot Journey JS and online events that should be firing, you can troubleshoot using the following steps.

1. Is Journey JS on your page and initializing?

To find out if journey JS is loaded on your page, open a browser (in this example, we're using Chrome) and open the debug console. In Chrome that is Ctrl+Shift+I on a PC or Command+Shift+I on a Mac.


Go to the Console tab. Clear the log and refresh the page. If journey.js is initializing correctly, you should see an entry that looks like: [journey.js] initializing

Additionally, if you type journey. in the console you should see a list of functions appear. If you see the list of functions, you know Journey JS is on the page. This will look like:

If you have plugins enabled and you are on a page that should have a Form tag, HVA tag, or Kiosk tag, but it does not, you will see a warning message that indicates the plugin can't be found. This will let you know if the plugin tag is missing.

If you have plugins enabled and you are on a page that shouldn't have any of these tags, the warning simply indicates the page correctly does not have those tags set.

2. Do you see any events coming through?

If Journey JS is on the page and initializing and the tags appear to be appropriately place on the page, you can check to see if events are firing.

To find any Touchpoint Interaction or Conversion events that are firing, go to the Network tab, select the Preserve log checkbox, clear the log, and refresh the page.

In the filter box, type events. You should see an entry that looks like events 201 xhr journey.xxx

When you click on the events Name, you will be able to see the details of the events. This is where you will see Touchpoint Interaction and Conversion event payload details.

For example, a pageload event will look like:

As another example, an HVA event would look like:

If you have Conversion events or other custom events, these will show up as separate events.

3. Does advanced debugging show any errors or warnings?

To turn on advanced debugging, within the console type journey.Debug.enable

When you refresh the page, you will get additional logging and warning information relating specifically to Journey JS. This can be helpful to troubleshoot why an event might not be firing.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.