Sending carts and displaying the game

Steps and examples to send shopping carts and display the game.

Google Tag Manager integration

Warning : Google Tag Manager integration requires some knowledge about such tag management system.

Datalayer and tag configuration issues within tag management system must be adressed to Google Tag Manager support team in the first place.

Files location and description

javascript/gtm.html : the HTML template code to be used in the tag

Integration steps

1. Create tags on pre-production and production

Create two codes/tags, one for pre-production (e.g. "Lucky Cart - test") and the other for production (e.g. "Lucky Cart - prod") with the following properties :

- Type : HTML personalised/custom
- Code HTML : copied from template above
- Trigger rules : exclusively on the order confirmation page of each environment without anymore restrictions

 

2. Adapt and configure tags

Modify each tag code to suit your needs, paying a special care to the followings :

  • API key, API secret and the URL to the luckyclient.min.js library are provided by Lucky Cart and must correspond to the targeted environment (production or pre-production/staging/test/dev)
  • datalayer macros/variables names and values {{...}} can differ from one customer to another

3. Insert game locator

Position the following container on the order confirmation page in the chosen position to display the game

<div id="luckygame">
  <!-- Luckycart plugin will be displayed here -->
</div> 

4. Trigger and publish tags

Trigger and publish each tag on the order confirmation page for every order, respecting the proper environnement.

Also make sure it is executed as soon as possible but after datalayer is populated and game locator is available in the dOM document.