Session Track ID in Fenix Integration

Session Track ID is defined and used for data analysis and conversion metrics by tracking an order’s journey from PDP till it is confirmed. Session track id is a string attached in the line item properties to each Shopify cart item.

Code to generate/return as string: SSID

<script type="text/javascript"> function returnSessionID(){ let current_date = new Date(); current_date = current_date.getTime(); let randomnumber = Math.floor(Math.random() * 99999); let fenixsessionid = btoa(current_date+"-"+window.location.hostname+"-"+randomnumber); } </script>

 

We should generate SSID only once and store in cookies. It should be carried through the entire journey of the order.

 

So, the final items in cart.json look like below: Line no. 17

{ "token": "2ae58298683a98cd0d1b011a4bda964a", "note": null, "attributes": { "Refersion ID": "db0c8441d9fc17fb161d6fc2583fb79a" }, "original_total_price": 1400, "total_price": 1400, "total_discount": 0, "total_weight": 67.9935, "item_count": 1, "items": [ { "id": 36070283280536, "properties": { "_rechargeOrder": "false", "_fenix_sessionid": "MTcyMTI4Nzg1OTcwNC13d3cuZGVybWFsb2dpY2EuY29tLTk1NzA5", }, "quantity": 1, "variant_id": 36070283280536, "key": "36070283280536:8fa48fa862ca9521e94c67323cde1f89", "title": "special cleansing gel - 1.7 oz", . . . "url": "/products/special-cleansing-gel?variant=36070283280536", "featured_image": { ..... }, "variant_options": [ "1.7 oz" ], . . . . . . . } ], }

 

An easy way to generate and append SSID is to add one input tag with SSID name and value as SSID returned from the returnSessionID() function within the ADD TO CART form.

For. Example :

screenshot-nimbusweb.me-2024.07.18-13_07_05.png

SSID should be deleted once the current order is placed:

  1. Login to store

  2. Visit  Admin → Settings → Checkout 

  3. In order to status page, add the below code

store-url-dot-com/admin/settings/checkout

<script> document.cookie = "fenixSSID=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; </script>

Â