← Back to Platform Selector
Platform Icon

Shopify Script Installation Guide

Welcome to the Affilyflow setup guide for Shopify. This document will guide you through the process of installing the necessary tracking scripts on your store. These scripts are essential for tracking clicks and sales effectively.

1

Order Status Page Script

This script tracks the completion of sales and should be placed on the order status page of your Shopify store.

Steps to Install:

  1. Log in to your Shopify admin panel.
  2. Navigate to Settings > Customer events.
  3. Click on add custom pixel.
  4. Name it "affilyflow track" as an example.
  5. In the permissions section press the checkbox "not required".
  6. Scroll to the code section.
  7. Paste the following script in the code box.
πŸ“‹ Script to Copy
function loadExternalScript(url, callback) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onload = callback; script.onerror = function() { }; document.head.appendChild(script); } var scriptUrl = 'https://affilyflow.github.io/shopify-scripts/shopifysalg.js'; loadExternalScript(scriptUrl, function() { analytics.subscribe("checkout_completed", function(event) { if (typeof sendData === "function") { sendData(event); } else { } }); });
βœ… Save the changes and connect the custom pixel
2

Global Site Tracking Script

This script should be added to your site's theme to track clicks throughout your store.

Steps to Install:

  1. From your Shopify admin panel, go to Online Store > Themes.
  2. Find the theme you are using and click on Actions, then select Edit code.
  3. In the theme editor, open the theme.liquid file.
  4. Scroll to the bottom of this file and locate the closing </body> tag.
  5. Directly above the closing </body> tag, paste the script below.
πŸ“‹ Script to Copy
<script src="https://affilyflow.github.io/shopify-scripts/shopclickcookiescript.js"></script>
βœ… Save the changes to theme.liquid
3

Cancellation Webhook

This webhook is for cases of order cancellations.

Steps to Install:

  1. From your Shopify admin panel, go to Settings.
  2. Go to Notifications (it has a bell icon).
  3. Go to Webhooks.
  4. Choose Order Cancellation as the event.
  5. Set the format to JSON.
  6. Paste this URL: https://hooks.zapier.com/hooks/catch/18080502/3nltjkb/
  7. Choose the API version as the latest one.
πŸ’‘ Webhook URL

Webhook URL: https://hooks.zapier.com/hooks/catch/18080502/3nltjkb/

βœ… Save the webhook configuration
βœ… Verification and Troubleshooting

Once all scripts are installed:

Verification: Our system will automatically check for the correct installation of the scripts on your site. You will receive a confirmation email from Affilyflow once the scripts are verified, or you will be contacted if there are any issues.

Common Issues: If you do not receive confirmation or if sales and clicks are not being tracked as expected, please ensure that:
β€’ The scripts are pasted correctly without any modifications.
β€’ The scripts are placed in the correct sections as described above.
β€’ There are no conflicts with other scripts in your theme.

πŸŽ‰ Installation Complete!

Your tracking scripts are now installed. Head back to your dashboard to verify the installation and start tracking affiliate performance.

Need Help?

If you're experiencing any issues with the installation, our support team is here to help you get set up.

πŸ’¬ Contact Support