Code Monkey home page Code Monkey logo

awin-tag's People

Contributors

bukashk0zzz avatar khorozhanov avatar omares avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

awin-tag's Issues

Pipes within item_id / item_sku in the items array lead to additional columns / column mismatch in product strings

Firstly thanks for building out this template it been really great to us and saved me a lot of time.

I have a issue with the product level tracking in the template due to the fact that our business include a pipe string of our component for a item_id For example P123|A123|D123. The replace method of the code does not encode or replace | leading to additional column in the product level tracking.

I know this is an edge case issues, and I tried to fix this issue myself with the following changes to the code but it does not appear to be working

I also dont see any console logs from your template even when in debug mode. Could not work out why.

Any help would be amazing.

const productRow =
        'AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}';
      if (getType(items) === 'array') {
        items.forEach((item, index) => {
          let item_id = item.item_id || '';
          item_id.replace('|','/');
          
          let value = productRow.replace(
            '{{advertiserId}}',
            item.advertiser_id || data.advertiserId || ''
          );
          value = value.replace(
            '{{orderReference}}',
            item.order_reference || eventData.transaction_id || ''
          );
          value = value.replace('{{productId}}', item_id || '');
          value = value.replace('{{productName}}', item.item_name || '');
          value = value.replace(
            '{{productItemPrice}}',
            getPriceString(item.price)
          );
          value = value.replace('{{productQuantity}}', item.quantity || '');
          value = value.replace(
            '{{productSku}}',
            item.item_sku || item_id || ''
          );
          value = value.replace(
            '{{commissionGroupCode}}',
            item.commission_group_code || 'DEFAULT'
          );
          value = value.replace(
            '{{productCategory}}',
            item.item_category || ''
          );
          requestUrl = requestUrl + '&bd[' + index + ']=' + value;
        });
      }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.