Glami piXel ieviešanas rokasgrāmata


Notikumi

Notikuma nosaukums Pievienot aprakstu Parametri Nepieciešamie parametri
PageView Noklusējuma notikums, ko var ievietot visās lapās.
ViewContent Kad lapa ir skatīta kā produkts vai kategorijas lapa. content_type, item_ids, value, currency content_type, item_ids
AddToCart Kad produkts ir pievienots iepirkumu grozam. value, currency, item_ids value, currency, item_ids
Purchase Kad tiek veikts pirkums. value, currency, transaction_id, item_ids value, currency, transaction_id, item_ids

Parametri

Parametra nosaukums Parametra apraksts Parametra tips
consent Lietotājs piekrīt analītisko sīkdatņu glabāšanai savās ierīcēs. Ja lietotājs ir devis atļauju, iestatiet 1. Pretējā gadījumā iestatiet 0 uz "nē". number
content_type Vai nu 'product' vai 'category'. string
item_ids Vienības identifikators, kas saistīts ar notikumu ViewContent, AddToCart or Purchase. Izmantojiet vērtības, kas ir unikālas un nemainīgas visā jūsu veikalā. Identifikators sastāv no jebkuras ciparu/virkņu kombinācijas. Izmantojiet to pašu ID, kuru norādījāt produkta plūsmā ITEM_ID. 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 Lietotāja vērtība uzņēmumam, kurš veic šo notikumu number
currency Valūta value. norādīta string
transaction_id Darījuma ID. string

Satura ID

Katrā gadījumā varat izmantot jebkuru no šiem identifikatoriem item_ids, category_text, lai identificētu ar notikumu saistīto saturu. Izmantojiet savam veikalam vispiemērotāko risinājumu. Lūdzu, izmantojiet tos pašus ID, kurus izmantojat savos product feed.


ITEM_ID

Šis ir unikāls produkta numurs - ID, kuru izmantojat savā e-veikalā.

GLAMI izmanto ITEM_ID, lai atšķirtu produktus un nodrošinātu pareizu izsekošanu.

  • Vērtība var sastāvēt no burtu, ciparu, slīpsvītru (/), slīpsvītru (\), domuzīmju (-), pasvītrojumu (_), atstarpēm (), punktiem (.) Un koliem (:).
  • Produktu variantiem, dažādiem izmēriem un krāsām jābūt unikāliem ITEM_ID.
  • Nodrošiniet to pašu vērtību GLAMI piXel - parametram ITEM_ID. Pretējā gadījumā GLAMI piXel nedarbosies pareizi.
  • 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 parametrs ļauj vietnēm pielāgot GLAMI Pixel darbību, pamatojoties uz lietotāja piekrišanas statusu saistībā ar sīkdatnēm. Ja lietotājs ir devis piekrišanas atļauju (value 1) vai parametrs nav iestatīts, GLAMI apstrādā visus datus. Ja lietotājs nav devis piekrišanas atļauju (value 0), dati tiek apstrādāti anonīmi, neizmantojot datus par konkrēto lietotāju.

GLAMI PiXel ir būtisks GLAMI interneta veikala optimālai darbībai. Tāpēc tagad tas atbalsta parametru Consent, kas ļauj partnera interneta veikalam sniegt GLAMI informāciju par to, vai lietotājs ir piekritis analītisko sīkdatņu izmantošanai.


Glami piXel koda piemēri


Šiem piemēriem nepieciešama API atslēga, kuru jūs saņemsiet pēc reģistrācijas veikalā.
Lai to izdarītu, izmantojiet mūsuveikala reģistrācijas lapu .

  • Produkta lapa -> ViewContent (type=product)
  • Kategorijas lapa -> ViewContent (type=category)
  • Pievienot iepirkuma grozam -> AddToCart
  • Pasūtījuma apstiprināšanas lapa -> Purchase
  • Katru otro lapu -> PageView

Pievienojiet kodu savas vietnes lapām pirms beigu etiķeti </head> lapas HTML:


PageView

Ievietojiet šo noklusējuma kodu visās lapās. Šo kodu var paplašināt, izmantojot citus notikumus. Skatīt zemāk.

<!-- 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',
    'lv',
    {
        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)

Pievienojiet šo pagarināšanas kodu katra produkta detaļu lapā.

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

Piemēram, produkta detaļu lapai.

Šis piemērs parāda kā izskatās pabeigts kods katra produkta detaļas lapās.

<!-- 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',
    'lv',
    {
        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)

Pievienojiet šo pagarināšanas kodu katrai kategorijas saraksta lapai.

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

Piemēram priekš kategorijas lapas.

Šis piemērs parāda kā izskatās pabeigts kods katrā no kategorijas saraksta lapām.

<!-- 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',
    'lv',
    {
        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

Tiek palaists šis kods notikumam, kad prece ir pievienota iepirkumu grozam.

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

Katrai pateicības/apstiprinājuma lapai pievienojiet šo paplašinājuma kodu.

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

Pateicības lapas/apstiprināšanas lapas piemērs.

Šajā piemērā parādīts, kā pabeigtam kodam vajadzētu izskatīties pateicības/apstiprināšanas lapā.

<!-- 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',
    'lv',
    {
        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 -->


Vairāku pikseļu ieviešana vienā lappusē

Izpildiet šos norādījumus, ja vienā lappusē vēlaties ievietot vairākus pikseļu kodus.

Ja vienā lappusē vēlaties ievietot vairākus pikseļu kodus, katrs pikselis jāidentificē ar unikālu nosaukumu. Realizējot, jūs norādīsiet šo nosaukumu. Ja ir tikai viens pikseļa kods, jums nav jāizmanto šis identifikators:

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

Tas pats unikālais nosaukums pēc tam jāizmanto palaižot šo pikseļa kodu:

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

Šajā piemērā parādīts, kā pabeigtam kodam vajadzētu izskatīties pateicības/apstiprināšanas lapā.

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

// <!-- LV tracker start
glami(
    'create',
    'LV_API_KEY',
    'lv',
    {
        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'
    }
);
// LV 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',
    lv,
    '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 -->

Izmantojot šo metodi, jebkurā laikā varat mainīt GLAMI Pixel piekrišanas parametra vērtību. Ja izmantojat sīkfailu piekrišanas pārvaldnieku (piemēram, Cookiebot vai citu), šī piekrišana ir jāiesniedz GLAMI Pixel pēc tās piešķiršanas. GLAMI Pixel bieži tiek ielādēts pirms faktiskās piekrišanas, izmantojot sīkfailu piekrišanas pārvaldnieku. Šādā gadījumā ir jāizmanto šī metode, lai piekrišanas parametram piešķirtu jaunu vērtību.


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

Satura drošības politikas (CSP) galvenes iestatījumi

Ja jūsu vietnē tiek izmantots Content Security Policy, jums ir jāiespējo GLAMI Pixel Javascript kods savā lapā. Lūdzu, pievienojiet tālāk norādītos CSP noteikumus HTTP atbildes galvenei savā tīmekļa serverī:

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