💻Script Integration
With this script, you can integrate all your Mazing.World products in bulks.
Last updated
With this script, you can integrate all your Mazing.World products in bulks.
Last updated
You can integrate your products with a 3D Button (leading to the 3D View) and an AR Button (leading to the AR View via QR code on desktop or open camera on a smartphone/tablet).
We recommend placing the 3D & AR Button underneath the product gallery or on the top right corner of the product image for the best user experience.
Simply upload all of your products into the Mazing.World. Then integrate our script at one position on your webshop or website. The script automatically tries to match an SKU with the current shown product of the shop and renders the 3D/AR buttons.
Check the SKU structure of your webshop in one of your product URLs, as an example:
In this example, the SKU would be specified as xyz123abc after the last occurrence of '/' in the product URL of the shop. There can also be various other formats.
Upload your products according to your SKU names to the Mazing.World. In this example, we upload the product xyz123abc, named exactly like we found in the URL parameter of our webshop.
Add the mazing script in the head part of your webshop or homepage.
Add the following script tag template to the end of your page body.
See API Details below for a full reference of all possible values. The most important values to be found are customerName, placementSelector, and getSKU().
Assume you have an online shop that is specified by the customerName as "flowershop". You can find this in the Mazing.World below your products.
customerName: 'flowershop'
The SKU names are specified inside your shop url like: https://flowershop.com/product/xyz123abc So the SKU is the last parameter in the URL. This would lead to a code for getSKU like:
This takes the last URL parameter split by '/' and returns it as SKU.
The last field you will need to find is the placementSelector. After a DOM check of all our shop elements, we want to place the Mazing buttons below our product gallery. We check the code and see that the product gallery is either specified by the id product-gallery or the class prod-gall uniquely.
Wechoose to use the id # product-gallery. placementSelector: '#product-gallery' or placementSelector: '.prod-gall'
Now you can have a look at the full integrated code and how it could look like:
threedBtn You can specify if the 3D button is shown and add a custom text. Also you can enable and disable the shipped icon. arBtn You can specify if the 3D button is shown and add a custom text. Also you can enable and disable the shipped icon.
customStyle: You can override or extend all CSS styles and classes you can see in this class: https://cdn.mazing.link/mzg-in.css
Here is an example how this could look like
placementSelector Can include either .class or #id selectors. The Mazing button container will be appended as a child to this element. customerName Your assigned customer name in the Mazing.World. You can find it below your Mazing.World products.
getSKU Callback Here you can specify how your unique identified product ID is found. Either you can use Google Tag Manager to return "{{TAG_ID}}" or you can make your own custom code and parse your shop URL to extract SKUs, etc.