Script Tag not loading on the Thank You Page.

Highlighted
Tourist
9 0 0

Hi All,

I am trying to create a script tag on the shopify store. But, it is not loading on the thank you page. I want to track the order success event on this page.

 

Code:

params = {'script_tag': {'src': <shopify_script_file>,'event': 'onload'}}
headers = {'Content-Type':'application/json','X-Shopify-Access-Token':<access_token>}

response = requests.post('https://<shop_name>/admin/api/2020-01/script_tags.json', headers=headers, json=params)

 

shopify_script_file content:

jQuery(document).ready(function() {
console.log('Script Loaded on Page:', window.location.href);
});

 

Issue:

The script is getting inserted in my test-development store.

The Script URL also starts from https. Still the console log in the script is not visible on the thank you page.

 

Can anyone please help me with the same.

 

Thanks

Ashlesha Deshpande

 

0 Likes