Beispiel #1
0
 def __init__(self):
     HasOffers.__init__(
         self,
         affiliate='shopstylers',
         network_id='sscpa',
         api_key='fd48513d3b1502e9e77d8ec0fd7ba28f43225ea44525d74271bb7706d588e851',
     )
Beispiel #2
0
 def __init__(self):
     HasOffers.__init__(
         self,
         affiliate='lazada',
         network_id='lazada',
         api_key='d7fb242b4dd56d243ccdfc435509fc8e454ebbd0e351801a116e67eec7a1a283',
         merchant_name='lazada',
         merchant_id='LZ',
     )
Beispiel #3
0
 def __init__(self):
     HasOffers.__init__(
         self,
         affiliate='BliBli',
         network_id='affiliateblibli',
         api_key=
         'eb57397bac4b0f307efdc90a1f5c42541f06dd8990da2908a566810164c6bb07',
         merchant_name='BliBli',
         merchant_id='blibli.com',
         currency='IDR')
Beispiel #4
0
 def __init__(self):
     HasOffers.__init__(
         self,
         affiliate='zalora',
         network_id='zalorasea',
         api_key=
         '60f10cb0a51c93ac9d0cd39943896e07dc948d8cfa33900a944c296a82032e7f',
         merchant_name='zalora',
         merchant_id='ZA',
     )
Beispiel #5
0
 def __init__(self):
     HasOffers.__init__(
         self,
         affiliate='berrybenka',
         network_id='berrybenka',
         api_key=
         '6fad99df15d13d45f3bdcec18e08c5a6ae85e7c6e8b46f191d8c8e69e116abae',
         merchant_name='BerryBenka',
         merchant_id='berrybenka.com',
         currency='IDR')
Beispiel #6
0
 def __init__(self):
     HasOffers.__init__(
         self,
         affiliate='mataharimall',
         network_id='mataharimall',
         api_key=
         '8364d537e84a82afb71e221a076a368d35f49c87ccdedf040e2d2637ee71c948',
         merchant_name='MatahariMall',
         merchant_id='MM101',  #TODO change the id to mataharimall.com
         currency='IDR')
Beispiel #7
0
    def get_transactions(self, start_date, end_date):
        conversions = HasOffers.get_transactions(self, start_date, end_date)

        if len(conversions) > 0:
            # remove invalid rows from wrong sync
            conversions = conversions[conversions['ho:Stat.pixel_refer'] != 'invalid_conversion']

            # setting order id
            conversions['ipg:orderId'] = conversions.apply(
                lambda x: x['ipg:orderId'] if pandas.notnull(x['ipg:orderId']) and (
                        len(x['ipg:orderId'].strip()) != 0 and str(x['ipg:orderId']).strip() not in ['ORDER_ID',
                                                                                                     'undefined'])
                else pandas.np.nan, axis=1)

            # setting the affiliate to the original one before syncing
            conversions['ipg:sourceAffiliate'] = conversions['ipg:affiliateNetwork']
            conversions['ipg:affiliateNetwork'] = conversions.apply(
                lambda x: parse.detect_original_affiliate(x['ipg:source'],
                                                          x['ho:Stat.affiliate_info4'],
                                                          x['ho:Stat.affiliate_info5']) or x['ipg:affiliateNetwork'], axis=1)

            conversions = self.detect_test_orders(conversions)
            conversions = self.detect_duplicated_orders(conversions)

        return conversions
Beispiel #8
0
    def get_transactions(self, start_date, end_date):
        # return empty resultset after Nov 30th 2017 as involveasia will be used
        if start_date > date(2017, 11, 30):
            return pandas.DataFrame()

        data = HasOffers.get_transactions(self, start_date, end_date)

        return data
Beispiel #9
0
    def get_performance(self, start_date, end_date):
        performance = HasOffers.get_performance(self, start_date, end_date)

        if len(performance) > 0:
            performance = self.detect_test_orders(performance)
            performance['ipg:sourceAffiliate'] = performance['ipg:affiliateNetwork']

        return performance
Beispiel #10
0
    def __init__(self):
        HasOffers.__init__(
            self,
            affiliate='ipricegroup',
            network_id='ipricegroup',
            api_key='NETJAz6IdhEXRABSEyWJgo2GLHz5mT',
            use_network_api=True
        )

        self.test_orders = {
            'ho:Stat.source': ['test', 'testoffer',
                               'testoffer??utm_medium=referral&utm_source=iprice&utm_campaign=affiliate'],
            'ho:Offer.name': ['iprice test offer', 'MY myVoucher', 'MK1 Offer', 'Test Store', 'Test Company Shop HK',
                              'voucher',
                              'Test Offer'],
            'ho:Stat.affiliate_info1': ['testoffer', 'test', 'Hussein', 'testofferthang'],
            'ho:Stat.affiliate_info2': ['Reza'],
            'ho:Stat.status_code': [21]
        }
Beispiel #11
0
    def get_transactions(self, start_date, end_date):
        data = HasOffers.get_transactions(self, start_date, end_date)

        if len(data) > 0:
            data['ipg:orderValue'] = data.apply(lambda x: (float(x['ho:Stat.payout']) / 0.0641) if (
                'mobile app' in x['ho:Offer.name'].lower() and
                datetime.strptime(x['ho:Stat.datetime'], '%Y-%m-%d %H:%M:%S') <= datetime(2016, 5, 31)) else
                x['ho:Stat.sale_amount'], axis=1)

        return data