...
Upgrading from the legacy widget is just as simple as replacing the old older integration script with the new one, which you can find herein the admin.
Since V2 mostly the Beta widget tracks activity using links instead of 3rd party cookies, you can also freely remove any ICS cookie tracking scripts that were previously necessary , further simplifying for the legacy widget, this should simplify the integration a bit. The
Any new links generated by V2 also the Beta widget will work retroactively with any legacy invites so you can upgrade to V2 the new widget without having to worry about creating a new campaign or missing out on any activity from old invites
If you’re using a direct JS installation of V2, refer to this guide.
If you’re using Shopify, you can reference this one.
Finally, if older invites or creating a new campaign.
Load the Legacy widget with the new integration script
If you’re not ready to fully commit to the changeBeta widget, you do always have the option of using the V2 script to load the legacy widget. For more information on that process, read:new integration script to load the Legacy widget.
The new script is backwards compatible so with a few adjustments to the code you can use it to load the older widget. Using the new integration script will also allow you to use the legacy widget without the additional cookie tracking script since it has been incorporated in the JS SDK instead.
Script Changes
Two adjustments need to be made to the integration script to support this:
Change the line that specifies the version from
version: 'latest'
toversion: 'v1'
Include
addTransaction()
function needed to log legacy influencers and transactions
Keep in mind, any addTransaction()
attributes will need to have their values adjusted to match the equivalents in your site.
Code Example
After making these changes, the resulting code will look something like this:
Code Block |
---|
<script>
window.onIcsLoaded = function() {
ICS.init({
version: 'v1',
publicKey: 'REPLACE',
campaignId: 'REPLACE',
});
ics('addTransaction', {
orderId: '{{order.order_number}}',
email: '{{order.email}}',
revenue: '{{checkout.line_items_subtotal_price | money_without_currency}}',
name: '{{customer.name}}',
inviteCookie: (document.cookie.match(/invite=([a-zA-Z0-9%]+)/) || [null] )[0],
transactionId: '{{transactions[0].receipt.transaction_id}}',
});
};
</script>
<script async defer crossorigin="anonymous" src="https://js.icecreamsocial.io/sdk.js" />
|