Documentation
Integrating the Script (for Shopify)
Now that you understand how our scripts work and their importance for both optimization and GDPR compliance, let's proceed to integrate them into your website. This step is crucial to start leveraging Optimeleon's capabilities for continuous, AI-driven optimization. Adding the script is as simple as copying a few lines and pasting it on your page!
Note: Creating campaigns for Shopify checkout pages is not allowed from Shopify's end due to security concerns.
Step 1: Add the Base Script to the <head> section
The base script is responsible for selecting variants and tracking user behavior in a cookieless manner. It ensures instant page loading without flickering and complies with GDPR regulations by not using cookies, only memory.
Instructions:
Locate the
<head>Section of Your WebsiteAccess your website's HTML files or your Content Management System (CMS) where you can edit the HTML code.
Find the
<head>section in your HTML code. This is typically near the top of your HTML file.
Paste the Base Script
Locate the "Script Version" dropdown on the top right of the Script Page and choose Shopify

Log in to your account and visit the
Scriptpage. (We recommend turning the Manual consent mode off and keeping the Reduce Flicker on.)
Copy the code
Insert the copied script tag within the
<head>section of your shopify theme. (Editing Shopify theme code)

Step 2: Create a Shopify pixel
You will need to create a custom pixel on your Shopify website if you are planning to track conversion events on the checkout page.
Jump to Step 3 on the Script page with Shopify selected as script version and copy the code provided there and paste it in your shopify pixel.
That is it. Once you create a campaign, your pages will automatically come to life!
This script enables cookieless tracking (if you have turned on Manually add consent) and instant variant selection based on factors like campaign URL, user data, optimization data collected, and AI prediction data.
Save and Publish
Save the changes to your HTML file or CMS template.
Ensure that the updated page is published and live on your website.
Optional Step 3: Activate First-Party Cookies After User Consent
Note: Follow this step only if you kept manual consent toggled on. This is for users who want explicit control over cookie usage, you can keep the "Manually add consent script" setting toggled on. Optimeleon will not use cookies in this case. Please read the Cookies section under "How it works?" to understand the trade offs.
When a user gives consent, execute the following function to activate first-party cookies:
This function signals the Optimeleon script to start using first-party cookies for enhanced tracking across your site.
Step 3: Validate Your Script Integration
Note: Validate Script function is currently unavailable for Shopify as Shopify hides the scripts
Tracking is one of the main functions of Optimeleon's script - mainly tracking your conversion events. You can perform a check to see whether Optimeleon is able to track events on your website by following the instructions on the Custom Events section. This is also a good indicator that other parts of Optimeleon's script are functioning.
Step 4: Next Steps
With the scripts successfully integrated, you're now ready to:
Create Campaigns:
Start setting up campaigns to test different variants of your pages.
Define hypotheses and target elements for optimization.
Monitor Performance:
Use the Optimeleon dashboard to track the performance of different variants.
Analyze user interactions and conversion metrics.
Leverage AI Optimization:
Allow our AI models to learn from the collected data.
Benefit from continuous optimization without manual intervention.
Important:
Please ensure that optimeleon is unblocked on your website mainly via a CSP meta tag on your website. This should look something like the following:
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self' *.optimeleon.com">Also a few tools like Cookiebot need to be instructed to allow Optimeleon scripts to run on your website.
Congratulations!
You've successfully integrated the Optimeleon scripts into your website. You're now on your way to unlocking the full potential of continuous, AI-driven optimization.
Integrating the Script (for Shopify)
Now that you understand how our scripts work and their importance for both optimization and GDPR compliance, let's proceed to integrate them into your website. This step is crucial to start leveraging Optimeleon's capabilities for continuous, AI-driven optimization. Adding the script is as simple as copying a few lines and pasting it on your page!
Note: Creating campaigns for Shopify checkout pages is not allowed from Shopify's end due to security concerns.
Step 1: Add the Base Script to the <head> section
The base script is responsible for selecting variants and tracking user behavior in a cookieless manner. It ensures instant page loading without flickering and complies with GDPR regulations by not using cookies, only memory.
Instructions:
Locate the
<head>Section of Your WebsiteAccess your website's HTML files or your Content Management System (CMS) where you can edit the HTML code.
Find the
<head>section in your HTML code. This is typically near the top of your HTML file.
Paste the Base Script
Locate the "Script Version" dropdown on the top right of the Script Page and choose Shopify

Log in to your account and visit the
Scriptpage. (We recommend turning the Manual consent mode off and keeping the Reduce Flicker on.)
Copy the code
Insert the copied script tag within the
<head>section of your shopify theme. (Editing Shopify theme code)

Step 2: Create a Shopify pixel
You will need to create a custom pixel on your Shopify website if you are planning to track conversion events on the checkout page.
Jump to Step 3 on the Script page with Shopify selected as script version and copy the code provided there and paste it in your shopify pixel.
That is it. Once you create a campaign, your pages will automatically come to life!
This script enables cookieless tracking (if you have turned on Manually add consent) and instant variant selection based on factors like campaign URL, user data, optimization data collected, and AI prediction data.
Save and Publish
Save the changes to your HTML file or CMS template.
Ensure that the updated page is published and live on your website.
Optional Step 3: Activate First-Party Cookies After User Consent
Note: Follow this step only if you kept manual consent toggled on. This is for users who want explicit control over cookie usage, you can keep the "Manually add consent script" setting toggled on. Optimeleon will not use cookies in this case. Please read the Cookies section under "How it works?" to understand the trade offs.
When a user gives consent, execute the following function to activate first-party cookies:
This function signals the Optimeleon script to start using first-party cookies for enhanced tracking across your site.
Step 3: Validate Your Script Integration
Note: Validate Script function is currently unavailable for Shopify as Shopify hides the scripts
Tracking is one of the main functions of Optimeleon's script - mainly tracking your conversion events. You can perform a check to see whether Optimeleon is able to track events on your website by following the instructions on the Custom Events section. This is also a good indicator that other parts of Optimeleon's script are functioning.
Step 4: Next Steps
With the scripts successfully integrated, you're now ready to:
Create Campaigns:
Start setting up campaigns to test different variants of your pages.
Define hypotheses and target elements for optimization.
Monitor Performance:
Use the Optimeleon dashboard to track the performance of different variants.
Analyze user interactions and conversion metrics.
Leverage AI Optimization:
Allow our AI models to learn from the collected data.
Benefit from continuous optimization without manual intervention.
Important:
Please ensure that optimeleon is unblocked on your website mainly via a CSP meta tag on your website. This should look something like the following:
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self' *.optimeleon.com">Also a few tools like Cookiebot need to be instructed to allow Optimeleon scripts to run on your website.
Congratulations!
You've successfully integrated the Optimeleon scripts into your website. You're now on your way to unlocking the full potential of continuous, AI-driven optimization.