====== Description ====== In this example we'll need to set up GTM custom variables, triggers and tags. This will allow us submitting the required data to Snapchat analytics. Bare in mind, this is an example of the Snapchat pixel set up and your final set up might differ. ===== Custom variables ===== As an example, we'll be creating Slip UUID custom variable. Let's visit Variables section in the GTM and click to create a new variable. The final result for the Slip UUID variable should look like this: {{:online:gtm:snapchat-pixel:slip_uuid-variable.png|}} In this case we: * Named the new variable as **Slip UUID** * Chose the Variable type to be **Data Layer Variable** * Data Layer Variable Name is **slipUUID** The most important part here is the Data Layer Variable Name, since this piece of data will be coming from our app and so we need to enter this key correctly. Other variables should be created using the same principle: ^ Variable name ^ Data Layer Variable Name ^ | Amount | amount | | Wallet type | walletType | | Event UUIDS | eventUUIDS | | Email | email | | Phone | phone | | Deposits count | depositsCount | ---- ===== Constants ===== We also need to create a couple constant variables. These will be used the same way as the variables in the previous section. === Currency === {{:online:gtm:snapchat-pixel:currency.png|}} Please make sure to replace 'EUR' currency with your own. === Number of slip items === {{:online:gtm:snapchat-pixel:number_of_slip_items.png|}} Please copy the JavaScript snippet below, as the one from screenshots is added just for display purposes. function () { var items = {{Event UUIDS}}; if (!items) { return 0; } return items.length; } === Snapchat pixel ID === {{:online:gtm:snapchat-pixel:snap_pixel_id.png|}} Please make sure to add your own Snapchat pixel ID. ===== Triggers ===== The triggers we'll be implementing: Bets (main wallet), FTD (First time deposit), Subsequent deposit, Registration finished. The most important parts are: * Event names (e.g. gtm-depositSuccess, gtm-registrationFinished, ...) * Correctly added previously created variables and their value comparisons, e.g. FTD trigger. * For up to date event names please check documention - https://wiki.advbet.com/admin/online-platform-cms/google-events?s[]=gtm&s[]=events#events-and-their-data-gtm. Let's implement these triggers according to the screenshots: ==== Bets (main wallet) ==== {{:online:gtm:bets_main_wallet_trigger.png|}} ==== FTD ==== {{:online:gtm:ftd_trigger.png|}} ==== Subsequent deposit ==== {{:online:gtm:subsequent_deposit_trigger.png|}} ==== Registration finished ==== {{:online:gtm:registration_finished_trigger.png|}} ===== Tags ===== Now we should have all variables, constants and triggers created. To integrate Snapchat pixel tags, we'll use Snap Pixel template and some examples of final tag setups can be found below. ==== Purchase ==== {{:online:gtm:snapchat-pixel:purchase_tag.png|}} ==== Add Billing ==== {{:online:gtm:snapchat-pixel:add_billing_tag.png|}} ==== Sign Up ==== {{:online:gtm:snapchat-pixel:sign_up_tag.png|}} ==== Subscribe ==== {{:online:gtm:snapchat-pixel:subscribe_tag.png|}}