# Debugging the SDK
Before enabling the SDK on your live store, we recommend you verify that data is sent correctly to QL.
The easiest way to debug the SDK, is to enable the SDK's debug mode, by loading the page you're trying to debug (product or payment confirmation pages), with
an additional query-string qldebug=1
.
For example, if our product page's URL is https://www.myvirtualstore.com/products/123
, we can enable the SDK's debug mode
by loading the page with the following URL: https://www.myvirtualstore.com/products/123?qldebug=1
# SDK Debug Mode
- Start by visiting one of your product pages where QL's SDK is enabled
- Now open your browser's Developer Tools console (CTRL+ALT+I / CMD+OPTION+I) and press on the "Console" tab
- Now change the page's URL to include
qldebug=1
in the query string
You should now see several output lines in your console with information about what the SDK is doing:
In case there are any errors in your SDK code, the SDK debugger will print the errors into the console, with additional information.
# Request Debugging
In case you cannot enable the SDK's debug mode, you can still see what information is sent to QL, by looking at your the Network tab in your browser's Developer Console, and filtering requests made to quicklizard.com:
If you see a request as above, it means that the SDK is successfully sending information to QL.
# SDK Embed Code Checklist
To ensure the SDK is embedded correctly, please go over the following checklist, and make sure each step is accurately fulfilled.
# Step 1 - SDK execution code
The SDK execution code should be available in your page, inside a <script>
tag, and placed as close as possible to the closing </body>
tag
<script>
window.QLAsync = function(QL){
// ... rest of execution code should be added here!
}
</script>
window.QLAsync
is a globally-defined function, that must be available on the Javascript window
object of your page
# Step 2 - SDK variables
Depending on the page the SDK is embedded in, your SDK execution code must contain all required variables in their correct type and format.
Please consult the SDK Method Signatures page for the correct type and format of each variable passed to the SDK.
# Step 2.1 - GTM variables
If you're using Google Tag Manager, you must make sure your GTM dataLayer
contains all the variables required by the SDK's execution code.
# Step 3 - SDK runtime inclusion
With your SDK execution code in place, you must ensure the actual SDK runtime is added to your page by placing the following <script>
tag
under your SDK execution code block.
<script src="//d3jdlwnuo8nsnr.cloudfront.net/sdk/v2.1/ql.js"></script>
Your complete embed code should look like this (SDK execution code must be added by you as per previous guides):
<script>
window.QLAsync = function(QL){
// ... rest of execution code should be added here!
}
</script>
<script src="//d3jdlwnuo8nsnr.cloudfront.net/sdk/v2.1/ql.js"></script>