Glami piXel įdiegimo vadovas


Veiksmai

Veiksmo pavadinimas Veiksmo aprašymas Parametrai Būtini parametrai
PageView Numatytasis veiksmas, kurį galima pridėti į visus puslapius.
ViewContent Kai naršoma tokiame puslapyje kaip, pavyzdžiui, produkto ar kategorijos puslapis. content_type, item_ids, value, currency content_type, item_ids
AddToCart Kai produktas įdedamas į pirkinių krepšelį. value, currency, item_ids value, currency, item_ids
Purchase Kai įvykdomas pirkimas. value, currency, transaction_id, item_ids value, currency, transaction_id, item_ids

Parametrai

Parametro pavadinimas Parametro aprašymas Parametro tipas
consent Vartotojo sutikimas, kad jo įrenginiuose būtų saugomi analitiniai slapukai. Jei vartotojas davė leidimą, nustatykite 1. Kitu atveju nustatykite 0 kaip "ne". number
content_type Arba „product“, arba „category“. string
item_ids Prekės identifikatorius, susietas su ViewContent, AddToCart or Purchase veiksmu. Naudokite reikšmes, kurios yra unikalios ir nekintančios visoje Jūsų parduotuvėje. Itentifikatorius susideda iš bet kokio skaičiaus / eilutės derinio. Naudokite tą patį ID, kurį pateikėte prekių sraute 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 Šį veiksmą vykdančio vartotojo pridedama vertė verslui number
currency Nurodyta value. valiuta. string
transaction_id Sandorio ID. string

Turinio ID

Kiekvieno veiksmo atveju galite naudoti bet kurį iš šių identifikatorių item_ids, category_text, kad identifikuotumėte su veiksmu susijusį turinį. Naudokite savo parduotuvei tinkamiausią sprendimą. Prašome naudoti tuos pačius ID, kuriuos naudojote product feed.


ITEM_ID

Tai yra unikalus produkto numeris - ID, kurį naudojate savo elektroninėje parduotuvėje.

GLAMI naudoja ITEM_ID gaminiams atskirti ir tinkamam stebėjimui užtikrinti.

  • Vertę gali sudaryti raidžių, skaičių, brūkšnių (/), pasvirųjų brūkšnių (\), brūkšnių (-), apatinių brūkšnių (_), tarpų (), taškų (.) Ir dvitaškių (:)) derinys.
  • Produktų variantai, skirtingi dydžiai ir spalvos turi turėti unikalius ITEM_ID.
  • Pateikite tą pačią GLAMI piXel vertę - parametrą ITEM_ID. Priešingu atveju GLAMI piXel neveiks tinkamai.
  • 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

Sutikimo parametras leidžia svetainėms koreguoti GLAMI Pixel elgseną pagal naudotojų sutikimo dėl slapukų būseną. Jei sutikimas yra (reikšmė 1) arba parametras nenustatytas, GLAMI apdoroja visus duomenis. Jei sutikimo nėra (reikšmė 0), duomenys bus tvarkomi anonimiškai, nenaudojant duomenų apie konkretų vartotoją.

GLAMI PiXel yra labai svarbus optimaliam jūsų elektroninės parduotuvės GLAMI veikimui. Todėl dabar palaiko sutikimo parametrą, kuriuo partnerio elektroninė parduotuvė perduoda GLAMI informaciją, ar vartotojas sutiko su analitinių slapukų kūrimu.


Glami piXel kodo pavyzdžiai


Nurodytuose pavyzdžiuose jums reikia API rakto, kurį gausite po parduotuvės registracijos.
Norėdami tai padaryti, naudokite mūsų el. parduotuvės registracijos puslapį .

  • Prekės puslapis -> ViewContent (type=product)
  • Kategorijos puslapis -> ViewContent (type=category)
  • Pridėti veiksmą į krepšelį -> AddToCart
  • Užsakymo patvirtinimo puslapis -> Purchase
  • Kas antras puslapis -> PageView

Pridėkite kodą savo svetainės puslapiuose prieš paskutinę </head> žymę puslapio HTML:


PageView

Įdėkite šį numatytąjį kodą į visus puslapius. Šį kodą galima išplėsti atliekant kitus veiksmus. Žiūrėkite žemiau.

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

Pridėkite šį plėtinio kodą kiekviename gaminio puslapyje.

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

Produkto informacijos puslapio pavyzdys.

Šis pavyzdys parodo, kaip visas kodas turėtų atrodyti kiekviename gaminio informacijos puslapyje.

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

Pridėkite šį plėtinio kodą kiekviename kategorijų sąrašo puslapyje.

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

Kategorijos puslapio pavyzdys.

Šis pavyzdys parodo, kaip visas kodas turėtų atrodyti kiekviename kategorijų sąrašo puslapyje.

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

Pateikite užklausą šiuo kodu atliekant veiksmą, kai prekė pridedama prie pirkinių krepšelio.

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

Pridėkite šį išplėstinį kodą kiekviename padėkos / patvirtinimo puslapyje.

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

Padėkos / patvirtinimo puslapio pavyzdys.

Šis pavyzdys parodo, kaip visas kodas turėtų atrodyti padėkos / patvirtinimo puslapyje.

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


Įdiekite kelis Pixels viename puslapyje

Vykdykite šias instrukcijas, kai norite sudėti kelis Pixel kodus į vieną puslapį.

Kai norite sudėti kelis Pixel kodus į vieną puslapį, kiekvienas Pixel turi būti identifikuojamas unikaliu pavadinimu. Šį vardą pateiksite kurdami skambutį. Kai yra tik vienas pixel kodas, jūs neturite naudoti šio identifikatoriaus:

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

Tuomet tas pats unikalus vardas turi būti naudojamas skambučiams dėl Pixel kodo:

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

Šis pavyzdys parodo, kaip visas kodas turėtų atrodyti padėkos / patvirtinimo puslapyje.

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

// <!-- LT tracker start
glami(
    'create',
    'LT_API_KEY',
    'lt',
    {
        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'
    }
);
// LT 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',
    lt,
    '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 -->

Naudodami šį metodą galite bet kada pakeisti sutikimo parametro reikšmę GLAMI Pixel. Jei naudojate slapukų sutikimo tvarkyklę (pvz., slapukų robotą ar kitą), šį sutikimą būtina pateikti GLAMI Pixel po to, kai jis bus suteiktas. GLAMI Pixel dažnai įkeliamas prieš faktinį sutikimą per slapukų sutikimo tvarkyklę. Tokiu atveju būtina iškviesti šį metodą ir sutikimo parametrui perduoti naują reikšmę.


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

Turinio saugos politikos (CSP) antraštės nustatymai

Jei žiniatinklyje naudojamas Content Security Policy, savo puslapyje turite įjungti GLAMI Pixel Javascript kodą. Please add the following CSP rules into your HTTP response header on your web server:

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