Název události | Popis události | Parametry | Požadované parametry |
---|---|---|---|
PageView | Základní událost k umístění na všechny stránky. | ||
ViewContent | Při zobrazení stránky, například stránky produktu nebo kategorie. | content_type, item_ids, value, currency | content_type , item_ids |
AddToCart | Událost, která se volá při vložení produktu do košíku. | value, currency, item_ids | value , currency , item_ids |
Purchase | Událost, která se volá při dokončení objednávky. | value, currency, transaction_id, item_ids | value , currency , transaction_id , item_ids |
Jméno parametru | Popis parametru | Typ parametru |
---|---|---|
consent | Souhlas uživatele s ukládáním analytických cookies v jeho zařízení. Nastavete 1 v případě získání souhlasu uživatele. V opačném případě nastavte 0 . |
number |
content_type | Buď 'product', nebo 'category'. | string |
item_ids |
Identifikátor produktu v asociované ViewContent , AddToCart or Purchase události. Musí být v rámci vašeho obchodu jedinečný a neměnný. Lze použít jakoukoliv kombinaci písmen a číslic. Uvádějte stejné ID, které používáte ve feedu pro ITEM_ID.
Pokud nemáte k dispozici ITEM_ID pro konkrétní variantu produktu v momentě volání eventu (například ve chvíli, kdy zákazník zatím nevybral konkrétní velikost produktu), můžete poslat hodnotu ITEMGROUP_ID do parametru item_ids. Ta musí odpovídat hodnotě, kterou posíláte v produktovém feedu u stejného produktu. |
array |
value | Hodnota produktu nebo objednávky při zavolání události | number |
currency | Měna pro specifikovanou value .. |
string |
transaction_id | ID transakce. | string |
V každé události použijte identifikátory item_ids
, category_text
. Použijte takové, které umožňuje řešení vašeho obchodu. Používejte stejné ID, jako v product feed.
Jedná se o jedinečné číslo produktu - ID, které používáte v e-shopu.
GLAMI používá ITEM_ID pro rozlišení produktů a pro zajištění správného sledování.
Parametr consent umožňuje zapojeným obchodům upravit chování GLAMI PiXelu vzhledem k souhlasu uživatelů s používáním souborů cookies. Pokud souhlas existuje (hodnota 1
) nebo parametr consent není nastaven, GLAMI zpracovává data v plném rozsahu. V případě, že souhlas neexistuje (hodnota 0
) budou údaje zpracovávány anonymně, bez použití údajů o konkrétním uživateli.
GLAMI PiXel je stěžejní pro optimální fungování vašeho e-shopu na GLAMI. Proto nyní podporuje parametr Consent, kterým partnerský e-shop předává GLAMI informaci, zda uživatel vyjádřil souhlas s vytvářením analytických cookies.
Pro následující příklady budete potřebovat API klíč, který obdržíte po registraci obchodu.
Pro tento účel využijte naši stránku pro registraci obchodu.
Kód přidejte na HTML stránky před konec tagu </head>
:
Umístěte tento hlavní kód na každé stránce. Tento kód lze rozšířit o další události podle typu stránky. Viz níže.
<!-- Glami piXel for PRIKLAD_OBCHODU --> <script> (function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i; f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s), n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n) })(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami'); glami( 'create', 'VLOŽTE_SVUJ_API_KLIC', 'cz', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); </script> <!-- End Glami piXel -->
Přidejte tento kód rozšíření na každou stránku s podrobnostmi o produktu.
glami( 'track', 'ViewContent', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] content_type: 'product', item_ids: ['ADZXFLUX002'] // currently viewed product ID. Use the same ID as you use in the feed (ITEM_ID) } );
Tento příklad zobrazuje, jak by měl vypadat úplný kód na všech stránkách s podrobnostmi o produktu.
<!-- Glami piXel for PRIKLAD_OBCHODU --> <script> (function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i; f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s), n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n) })(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami'); glami( 'create', 'VLOŽTE_SVUJ_API_KLIC', 'cz', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'ViewContent', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] content_type: 'product', item_ids: ['ADZXFLUX002'] // currently viewed product ID. Use the same ID as you use in the feed (ITEM_ID) } ); </script> <!-- End Glami piXel -->
Přidejte tento rozšířený kód na každou stránku se seznamem kategorií.
glami( 'track', 'ViewContent', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] content_type: 'category', item_ids: ['ADZXFLUX001', 'NRS02', 'NRS03', 'NRS04', 'NRS05', 'NRS06', 'NRS07', 'NRS08', 'NRS09', 'NRS10'], // currently viewed first 10 product IDs in the category. Use the same IDs as you use in the feed (ITEM_ID). category_text: 'Men | Shoes | Sneakers' // currently viewed category_text. Use the same category_text as you use in the feed (CATEGORYTEXT) } );
Tento příklad ukazuje, jak by měl vypadat úplný kód na všech stránkách se seznamem kategorií.
<!-- Glami piXel for PRIKLAD_OBCHODU --> <script> (function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i; f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s), n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n) })(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami'); glami( 'create', 'VLOŽTE_SVUJ_API_KLIC', 'cz', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'ViewContent', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] content_type: 'category', item_ids: ['ADZXFLUX001', 'NRS02', 'NRS03', 'NRS04', 'NRS05', 'NRS06', 'NRS07', 'NRS08', 'NRS09', 'NRS10'], // currently viewed first 10 product IDs in the category. Use the same IDs as you use in the feed (ITEM_ID). category_text: 'Men | Shoes | Sneakers' // currently viewed category_text. Use the same category_text as you use in the feed (CATEGORYTEXT) } ); </script> <!-- End Glami piXel -->
Tento kód volejte při události kdy dochází ke vložení položky do košíku.
glami( 'track', 'AddToCart', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002'], // product ID currently added to a cart. Use the same ID as you use in the feed (ITEM_ID). value: 2495.00, // product price currency: 'CZK' // product price currency } );
Umístěte toto rozšíření na stránku potvrzující odeslání objednávky.
glami( 'track', 'Purchase', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002', 'NRS01'], // bought product IDs. Use the same IDs as you use in the feed (ITEM_ID). value: 3742.50, // order value (sum of product values) currency: 'CZK', // order value currency transaction_id: 'ORDER212' // order ID } );
Tento příklad demonstruje, jak vypadá kompletní kód pro potvrzující stránku objednávky.
<!-- Glami piXel for PRIKLAD_OBCHODU --> <script> (function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i; f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s), n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n) })(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami'); glami( 'create', 'VLOŽTE_SVUJ_API_KLIC', 'cz', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'Purchase', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002', 'NRS01'], // bought product IDs. Use the same IDs as you use in the feed (ITEM_ID). value: 3742.50, // order value (sum of product values) currency: 'CZK', // order value currency transaction_id: 'ORDER212' // order ID } ); </script> <!-- End Glami piXel -->
Pokud chcete umístit více pixel kódů na jednu stránku, postupujte podle následujících pokynů.
Pokud chcete vložit několik pixelových kódu na jednu stránku, každý pixel musí mít unikátní název, který je vytvořen v úvodním volání create. Tato identifikace se nemusí používat, pokud používáte jen jeden pixel kód.
glami( 'create', 'API_KEY', 'cz', 'PIXEL_IDENTIFIER', { consent: 1 // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } );
Stejné unikátní jméno musí být použito ve všech voláních pixel kódů:
glami( 'PIXEL_IDENTIFIER.track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'PIXEL_IDENTIFIER.track', 'Purchase', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002'], value: 3742.50, // order value (sum of product values), currency: CZK, transaction_id: 'ORDER2' } );
Tento příklad demonstruje, jak vypadá kompletní kód pro potvrzující stránku objednávky.
<!-- Glami piXel for multiple shops --> <script> (function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i; f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s), n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n) })(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami'); // <!-- CZ tracker start glami( 'create', 'CZ_API_KEY', 'cz', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'track', 'Purchase', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002', 'NRS01'], value: 3742.50, currency: 'CZK', transaction_id: 'ORDER1' } ); // CZ tracker end --> // <!-- SK tracker start glami( 'create', 'SK_API_KEY', 'sk', 'sktracker', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'sktracker.track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'sktracker.track', 'Purchase', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002'], value: 50.00, currency: 'EUR', transaction_id: 'ORDER2' } ); // SK tracker end --> // <!-- some other tracker tracker start glami( 'create', 'SOME_OTHER_API_KEY', cz, 'sometrackername', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'sometrackername.track', 'PageView', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] } ); glami( 'sometrackername.track', 'Purchase', { consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes] item_ids: ['ADZXFLUX002'], value: 3742.50, // order value (sum of product values), currency: CZK, transaction_id: 'ORDER2' } ); // some other tracker end --> </script> <!-- End Glami piXel -->
Pomocí této metody můžete kdykoliv změnit hodnotu consent parametru pro GLAMI Pixel. V případě, že používáte Cookie consent manager (např. Cookiebot nebo jiný), je nutné po udělení souhlasu tento souhlas předat i do GLAMI Pixel. GLAMI Pixel je často načten ještě před samotným udělením souhlasu skrze Cookie consent manager. V takovémto případě je nutné zavolat následující metodu a předat novou hodnotu consent parametru.
glami('set', {consent: 1});
Pokud váš web používá Content Security Policy, musíte na vaší stránce povolit spouštění GLAMI Pixel JavaScript kódu. Prosím, přidejte následující CSP pravidla do HTTP response hlavičky na vašem web serveru:
Content-Security-Policy: default-src 'self'; script-src 'unsafe-inline' www.glami.cz glamipixel.com; img-src www.glami.cz glamipixel.com