Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Nazari samnazari

View GitHub Profile
@samnazari
samnazari / cartIntegration.js
Created May 30, 2017
Ascend - Shopify - Shopping Cart Integration
View cartIntegration.js
<script type="text/javascript">
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
var ascendCookies = getCookie('_ascend_current');
var ascendInput = document.createElement('input');
ascendInput.type = 'hidden';
ascendInput.name = 'attributes[ascend]';
@samnazari
samnazari / checkoutPageCode_Conversions.liquid
Created May 30, 2017
Sentient Ascend - Shopify Integration - Goal: Conversions
View checkoutPageCode_Conversions.liquid
{% if first_time_accessed %}
<script type="text/javascript">
function createCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + value + expires + ";";
@samnazari
samnazari / checkoutPageCode_Revenue.liquid
Created May 30, 2017
Sentient Ascend - Shopify Integration - Conversion Goal - Revenu
View checkoutPageCode_Revenue.liquid
{% if first_time_accessed %}
<script type="text/javascript">
function createCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + value + expires + ";";
You can’t perform that action at this time.