This article covers these topics :
1. Connect your e-shop
2. Remove ShipupJS from all page

1. Connect your e-shop

Nothing simpler: we already have an integration on the store. 

Go on : https://app.shipup.co/apps/new/shopify

Enter the URL of your store and click 'connect'. 


2. Remove ShipupJS from all page

For simplicity reasons, ShipupJS is loaded on all pages of a Shopify store upon installation. That means that our library will be loaded on the page hosting the tracking page, allowing it to be displayed (👍), but also on pages such as the homepage where it has no usage and slows down loading (👎).

How to solve this ?

This can be avoided with a few steps :

  1. On your Shopify admin, go to the page editor (Sales Channels > Online Store > Pages)

2. Find and click on the page that was previously created for the tracking page, to open the editor


3. In the editor, click on <> (Show HTML) and copy paste this snippet. Click on Save

<div id="shipup-root" style="min-height: 300px;">
</div>

<script>
(function() {
var cssSrc = 'https://cdn.shipup.co/latest_v2/shipup.css';
var jsSrc = 'https://cdn.shipup.co/latest_v2/shipup-js.js';
var scriptDomId = 'shipup-script';

var loadShipupJS = function() {
var LoadedShipupJS = "function" == typeof define && define.amd ?
require('ShipupJS') :
window.ShipupJS;
if (LoadedShipupJS && window.Shopify && window.Shopify.shop) {
var shipup = new LoadedShipupJS.default(null);
var element = document.getElementById('shipup-root');
if (element) {
shipup.render(element);
};
};
};

var addShipupCSS = function() {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = cssSrc;
link.media = 'all';
head.appendChild(link);
};

if (!document.getElementById(scriptDomId)) {
var script = document.createElement('script');
script.id = scriptDomId;
script.type = 'text/javascript';
script.async = true;
script.src = jsSrc;
script.onload = loadShipupJS;
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(script, x);
};


var hasCssSrc = function(link) {
return link.href.indexOf(cssSrc) > -1;
};
var linkList = document.getElementsByTagName('link');
var links = Array.prototype.slice.call(linkList);
if (!Array.prototype.some || !links.some(hasCssSrc)) {
addShipupCSS();
};
})();
</script>

4) Verify that the tracking page works as before. You can now contact Shipup Team to remove ShipupJs from the other pages of the site.

Did this answer your question?