Skip to main content
All CollectionsIntegration GuidesE-CommerceShopify Add-Ons
Cross-Domain Tracking with Shopify with Permalinks
Cross-Domain Tracking with Shopify with Permalinks

A guide to using external landing pages with your Shopify offers if you are using a Shopify permalink.

Genny avatar
Written by Genny
Updated over a year ago

This process is intended to increase accuracy when using cross-site tracking - going from an external landing page to Shopify. Please note that you *must* be familiar with JavaScript to complete this setup.


Step #1

  • When adding or editing an Offer in Everflow, be sure of the following:

    You have entered the landing page URL as the Base Destination URL.

    Direct Linking is enabled under Tracking & Control.

    For more information on Offer setup - [Click here]

Step#2

  • Follow the steps in this article from Shopify to set up the permalink to take users from your landing page to the checkout page within your Shopify store.

Step #3

  • Place this custom JavaScript into the <head> of your website. Please note that this is not universal code, which means that the code that grabs the button will need to be changed. Be sure to replace {insert_your_tracking_domain} with your own domain.

<script type="text/javascript" 
src="https://{insert_your_tracking_domain}/scripts/sdk/everflow.js"></script>

<script type="text/javascript">
EF.click({
offer_id: EF.urlParameter('oid'),
affiliate_id: EF.urlParameter('affid'),
sub1: EF.urlParameter('sub1'),
sub2: EF.urlParameter('sub2'),
sub3: EF.urlParameter('sub3'),
sub4: EF.urlParameter('sub4'),
sub5: EF.urlParameter('sub5'),
uid: EF.urlParameter('uid'),
transaction_id: EF.urlParameter('_ef_transaction_id'),
}).then(function(transaction_id) {

/*The following section is specific to your landing page setup and requires knowledge of JavaScript*/

var EFcheckoutURL = document.getElementById('Iea67b141cf994bd794ca73d2f9977963_sys_button').children[0].href
var url = new URL(EFcheckoutURL);
url.searchParams.append('attributes[eftid]', transaction_id);
document.getElementById('Iea67b141cf994bd794ca73d2f9977963_sys_button').children[0].href = url.href
});
</script>

Step #4

  • In Shopify, navigate to Settings > Checkout.

Step #5

  • Place this code in the Additional Scripts section. Be sure to replace {insert_your_tracking_domain} with your tracking domain and {advertiser_id} with the Advertiser ID found on the offer page in Everflow.

<script type="text/javascript" 
src="https:// {insert_your_tracking_domain}/scripts/sdk/everflow.js"></script>

<script type="text/javascript">
var EFTID = "{{ attributes.eftid }}";
var aid = {advertiser_id};
var amount = Shopify.checkout.subtotal_price;
var order;
if (Shopify.checkout.discount != null) {
order = {
oid: Shopify.checkout.order_id,
amt: Shopify.checkout.subtotal_price,
bs: Shopify.checkout.shipping_address ? Shopify.checkout.shipping_address.province : '',
bc: Shopify.checkout.shipping_address ? Shopify.checkout.shipping_address.country : '',
cc: Shopify.checkout.discount.code,
items: []
};
} else {
order = {
oid: Shopify.checkout.order_id,
amt: Shopify.checkout.subtotal_price,
bs: Shopify.checkout.shipping_address ? Shopify.checkout.shipping_address.province : '',
bc: Shopify.checkout.shipping_address ? Shopify.checkout.shipping_address.country : '',
cc: "",
items: []
};
}
Shopify.checkout.line_items.forEach(function (line_item) {
var item = {};
item['ps'] = line_item.sku;
item['p'] = line_item.price;
item['qty'] = line_item.quantity;
order.items.push(item);
});
EF.conversion({
aid: aid,
amount: amount,
order: order,
order_id: Shopify.checkout.order_id,
transaction_id: EFTID,
parameters: {'email':Shopify.checkout.email}
})
</script>


Did this answer your question?