Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function sendProductEventToAdoric() {
- var productId = document.querySelector('[data-productid]');
- if (productId && window.adoric && window.adoric.trigger) {
- productId = productId.getAttribute('data-productid');
- adoric.trigger("pageview", {
- type: "product",
- ids: productId,
- });
- }
- }
- function waitAdoric() {
- if (window.adoric) {
- sendProductEventToAdoric();
- } else {
- document.addEventListener('adoric-loaded', function() {
- sendProductEventToAdoric();
- });
- }
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', waitAdoric);
- } else {
- waitAdoric();
- }
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement