Glami piXeli rakendamise juhend


Sündmused

Sündmuse nimetus Sündmuse kirjeldus Parameetrid Nõutud parameetrid
PageView Standardne sündmus, mille saab paigutada kõikidele lehtedele.
ViewContent When a page is viewed such as a product or category page. content_type, item_ids, value, currency content_type, item_ids
AddToCart Kui toode lisatakse ostukorvi. value, currency, item_ids value, currency, item_ids
Purchase Kui sooritatakse ost. value, currency, transaction_id, item_ids value, currency, transaction_id, item_ids

Parameetrid

Parameetri nimetus Parameetri kirjeldus Parameetri tüüp
consent Kasutaja nõusolek analüütiliste küpsiste salvestamiseks tema seadmetesse. Määra 1 juhuks, kui kasutaja andis loa. Kui kasutaja ei ole luba andnud ja vastus on "ei", siis määra 0. number
content_type Either 'product' or 'category'. string
item_ids ViewContent, AddToCart or Purchase sündmusega seotud toote ID. Kasuta kogu oma e-poes ainulaadseid ja muutumatuid väärtusi. Identifier kood koosneb mis tahes numbri/nime kombinatsioonidest. Kasuta sama ID-d, mida kasutad tootevoos ITEM_ID jaoks. If you do not have the ITEM_ID for a specific product variant at the time of calling the event (for example, when the customer has not yet selected a specific size for the product), you can send the value of ITEMGROUP_ID to the item_ids parameter. This value must correspond with the value you send in the product feed. array
value Selle sündmuse sooritanud kasutaja väärtus ettevõttele number
currency value. jaoks määratletud valuuta. string
transaction_id Tehingu ID. string

Sisu ID-d

Iga sündmuse juures on võimalik kasutada mis tahes identifikaatorit item_ids, category_text, et identifitseerida sündmusega seotud sisu. Kasuta oma poe jaoks kõige sobivamat lahendust. Palun kasuta samasid ID-sid, mida kasutad product feed.


ITEM_ID

See on kordumatu tootenumber - ID mida saad kasutada oma e-poes.

GLAMI kasutab toodete eristamiseks ja nõuetekohase jälgimise tagamiseks ITEM_ID.

  • Väärtus võib koosneda tähtede, numbrite, kaldkriipsude (/), kaldkriipsude (\), kriipsude (-), alakriipsude (_), tühikute (), punktide (.) Ja koolonite (:) kombinatsioonist.
  • Tootevariantidel, erinevatel suurustel ja värvitoonidel peavad olema kordumatud ITEM_ID.
  • Anna GLAMI piXelile sama väärtus - parameeter ITEM_ID. Vastasel juhul ei tööta GLAMI piXel korralikult.
  • If you do not have the ITEM_ID for a specific product variant at the time of calling the event (for example, when the customer has not yet selected a specific size for the product), you can send the value of ITEMGROUP_ID to the item_ids parameter. This value must correspond with the value you send in the product feed.


Consent

Consent parameeter võimaldab veebilehtedel kohandada GLAMI PiXeli käitumist vastavalt kasutajate küpsiste consent staatusele. Kui consent on olemas (väärtus 1) või parameeter ei ole määratud, töötleb GLAMI andmeid täies mahus. Kui consent puudub (väärtus 0), töödeldakse andmeid anonüümselt, ilma konkreetse kasutaja andmeid kasutamata.

GLAMI PiXel on ülioluline teie e-poe optimaalseks toimimiseks GLAMI lehel. Seetõttu toetab see nüüd Consent parameetrit, millega partneri e-pood edastab GLAMI-le infot selle kohta, kas kasutaja on analüütiliste küpsiste loomisega nõus või mitte.


Glami piXel koodi näited


Järgnevate näidete jaoks vajad API-võtit, mille saad pärast poe registreerimist.
Selleks ava poe registreerimise leht.

  • Product page -> ViewContent (type=product)
  • Category page -> ViewContent (type=category)
  • Ostukorvi lisamise sündmus -> AddToCart
  • Tellimuse kinnitamise leht -> Purchase
  • Iga teine leht -> PageView

Lisa kood e-poe lehtedele enne </head> lehe HTML-koodis:


PageView

Paigalda see vaikekood igale lehele. Seda koodi saab laiendada teiste sündmuste kasutamisega. Vt allpool.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<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',
    'INSERT_YOUR_API_KEY_HERE',
    'ee',
    {
        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 -->


ViewContent (product)

Add this extension code to every product detail page.

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)
    }
);

Example for product detail page.

This example shows how should complete code looks like in every product detail pages.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<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',
    'INSERT_YOUR_API_KEY_HERE',
    'ee',
    {
        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 -->


ViewContent (category)

Add this extension code to every category list page.

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)
    }
);

Example for category page.

This example shows how should complete code looks like in every category list pages.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<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',
    'INSERT_YOUR_API_KEY_HERE',
    'ee',
    {
        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 -->


AddToCart

Kui toode on ostukorvi lisatud, päri see kood.

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: 82.00, // product price
        currency: 'EUR' // product price currency
    }
);


Purchase

Lisa laienduskood igale tellimus eest tänamise / tellimuse kinnituse lehele.

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: 123.00, // order value (sum of product values)
        currency: 'EUR', // order value currency
        transaction_id: 'ORDER212' // order ID
    }
);

Näide tellimuse eest tänamise / kinnituse lehe jaoks.

Selles näites on välja toodud, kuidas kogu tellimuse eest tänamise / kinnituse lehe kood välja peaks nägema.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<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',
    'INSERT_YOUR_API_KEY_HERE',
    'ee',
    {
        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: 123.00, // order value (sum of product values)
        currency: 'EUR', // order value currency
        transaction_id: 'ORDER212' // order ID
    }
);
</script>
<!-- End Glami piXel -->


Mitme piksli rakendamine ühel lehel

Järgi neid juhiseid, kui soovid paigutada ühele lehele mitu pikslikoodi.

Kui soovid asetada ühele lehele mitu pikslikoodi, tuleb iga piksel identifitseerida kordumatu nimetusega. See nimetus tuleb esitada loomise päringu esitamisel. Kui pikslikoode on ainult üks, ei pea seda identifikaatorit kasutama:

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]
    }
);

Sama pikselkoodi kõnede jaoks tuleb kasutada sama kordumatut nime:

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: 123.00, // order value (sum of product values),
        currency: EUR,
        transaction_id: 'ORDER2'
    }
);

Selles näites on välja toodud, kuidas kogu tellimuse eest tänamise / kinnituse lehe kood välja peaks nägema.

<!-- 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');

// <!-- EE tracker start
glami(
    'create',
    'EE_API_KEY',
    'ee',
    {
        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: 123.00,
        currency: 'EUR',
        transaction_id: 'ORDER1'
    }
);
// EE 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',
    ee,
    '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: 123.00, // order value (sum of product values),
        currency: EUR,
        transaction_id: 'ORDER2'
    }
);
// some other tracker end -->
</script>
<!-- End Glami piXel -->

Selle meetodi abil saad GLAMI Pixeli Consent parameetri väärtust muuta igal ajal. Juhul, kui kasutad Cookie Consent Manager'i (küpsiste nõusolekuhaldurit, nt. cookiebot vms), on Consent vajalik esitada GLAMI Pixelile peale selle saamist. GLAMI Pixel laetakse läbi Cookie Consent Manager'i sageli enne tegeliku nõusoleku saamist . Sellisel juhul on vaja kasutada järgnevat meetodit ja anda Consent parameetrile uus väärtus.


glami('set', {consent: 1});
            

Content Security Policy (CSP) päise seaded

Kui su veeb kasutab Content Security Policy, pead sa oma lehel lubama GLAMI Pixeli Javascript koodi. Palun lisa järgmised CSP-reeglid oma veebiserveri "HTTP response" päisesse:

Content-Security-Policy: default-src 'self'; script-src 'unsafe-inline' www.glami.ee glamipixel.com; img-src www.glami.ee glamipixel.com