This article applies to you if you use the self-implementation method.
The purpose of this script is to collect information about transactions made in the online shop.
Its content can be found in the section Settings -> My Scripts -> Tagging product page and transactions -> ThankYou Page Tag.
What does the script do?
The script collects and processes the following dynamic variables:
- transaction – unique transaction id registered in the shop
- user – id of the user who made the purchase. If the user is not logged in, pass an empty value (upsParams.push(['user', "]);)
- product – unique product id
- price – price of the product
- quantity – quantity of a given product
Where do you have to paste it?
In order the script to work properly, it must be placed on the ThankYou page and the relevant variables must be provided:
SCRIPT_TRANSACTION_ID - unique transaction ID
SCRIPT_USER_ID - p this variable is optional; if user_id is available as a customer after logging in to the shop, insert it here, if not, leave the string blank
/* SCRIPT_LOOP_START*/ - here you need to create a loop that will jump over all purchased products and extract from them the following data:
SCRIPT_PRODUCT_ID - unique product ID, must match the catalogue data
SCRIPT_PRICE- unit price of the product
SCRIPT_QUANTITY - the number of items purchased
/* SCRIPT_LOOP_END */ - end of the loop
How will you check if the script works correctly?
To verify the correct operation of the script, check if the completed code appears in the source of the page.
If all required variables have been correctly defined and the script has been run, a request t.php* should appear in the Network section.
*Applies to Google Chrome browser.
Just like the product view script, the above script works if it is correctly implemented together with the QuarticOn main script, which should be placed on every page of the e-shop.