Commit 0b9846c7 by liuxiaoxing

预约归因逻辑

parent 27a48cd5
......@@ -38,8 +38,8 @@ ry_adplan_name = 'c测试1'
ry_adcreative_name = 'c测试1'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid = 'rryingxiao_int'
# URL = 'http://uri6.com/tkio/JFFnQ3a?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/FrEBnea?noredirect=true'
URL = 'http://uri6.com/tkio/ieMryea?noredirect=true'
# URL = 'http://52.80.137.106:8083/tkio/mYrAzqa?noredirect=true'
# 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
......@@ -60,7 +60,7 @@ def computeMD5upper(message):
return m.hexdigest().upper()
appkey = 'a57ba9d2c364a49f43f59cb33d96577e'
appkey = '8a390227254c03dbcaddbca009cd6e8b'
lst = []
nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
s = 0
......@@ -77,7 +77,7 @@ for index in range(1):
# adid = '5011813780042235'
p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# accountid = '032273574734'
# accountid = '0426886726981'
# p1 = '测试一下'
# "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83',
# "idfa": '00000000-0000-0000-0000-000000000000',
......@@ -126,11 +126,11 @@ for index in range(1):
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
# 投放广告详情相关指标,以下四个指标相关联
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id,
# # 账户id
# "accountid": accountid
"ry_adgroup_id": ry_adgroup_id,
"ry_adplan_id": ry_adplan_id,
"ry_adcreative_id": ry_adcreative_id,
# 账户id
"accountid": accountid
# 'imei2': 'null',
# 'meid': i
# 'bd_vid': i
......@@ -279,7 +279,7 @@ for index in range(1):
# num = index + 1
# event = 'event_' + str(num)
# event = 'event_30'
# event = 'event_24'
# time.sleep(3)
# try:
# allEvent().ziding_event(i, ip, appkey, event)
......
......@@ -77,6 +77,7 @@ class allEvent:
# "_campaignid": 'default',
"_deviceid": i,
"_imei": i,
"_meid":i,
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"96AD0BC02C70D0BA5C446C12580E3800\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
# '_oaid': '697134960e9ff8df46f21b4f97db595a1',
# "_rdid": '09DA91D0664C33DA7BEE7294CCCCCA07',
......@@ -268,6 +269,7 @@ class allEvent:
# "_apptype": "wap",
'_deviceid': i,
'_imei': i,
"_meid": "1232112221",
# "_idfv": i,
# '_androidid':i,
'_ip': IP,
......@@ -293,8 +295,8 @@ class allEvent:
'context': {
# "_apptype": "wap",
'_deviceid': i,
# '_imei': i,
"_idfv": i,
'_imei': i,
"_meid": i,
'_androidid': i,
'_ip': IP,
'_ryos': ryos,
......@@ -447,11 +449,11 @@ class allEvent:
'_ryos': ryos,
"_lib_version": lv,
'_key_action_category': '1',
'_key_action_threshold': '15',
# '_key_action_threshold': '15',
# 识别是否为自定义事件,默认传1
'_isreyundefaultevent': '1',
# 'who': 'lxxtest',
'param7': '5',
'params5': '10',
},
......
......@@ -8,7 +8,7 @@ import hashlib
#安卓常规渠道激活
appkey = '0ecc232109dc25bfedff8aba06271539'
appkey = 'b34100cdf5b586774e5d4dd4357c7b17'
# 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd
......@@ -38,8 +38,8 @@ for index in range(1):
# p = '987654321234567'
# s = '2321321312h8ro321'
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '278623364297'
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = 'R2G4QK6J866RLP956230ND71ML1H5UZ0'
# i = '00000000-0000-0000-0000-000000000000'
# 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
......@@ -48,7 +48,7 @@ for index in range(1):
# 60.13.148.23 新疆维吾尔自治区吐鲁番市
# 61.139.239.255 广西壮族自治区北海市
# 119.60.0.0 宁夏回族自治区银川市
# allEvent().installUpload(i, ip, appkey)
allEvent().installUpload(i, ip, appkey)
# time.sleep(1)
# allEvent().startupEvent(i, ip, appkey)
# # time.sleep(1)
......@@ -57,7 +57,7 @@ for index in range(1):
# allEvent().registerEvent(i, ip, appkey)
# allEvent().payEvent(i, ip, appkey)
# time.sleep(1)
allEvent().payorder(i, ip, appkey)
# allEvent().payorder(i, ip, appkey)
# time.sleep(1)
# num = index + 1
# event = 'event_' + str(num)
......
......@@ -8,12 +8,12 @@ import time
#向短链发送点击数据
#!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/6RFjMra?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/6JZBBva?noredirect=true'
URL = 'http://uri6.com/tkio/VFf22ea?noredirect=true'
# URL = 'http://52.80.137.106:8083/tkio/6JZBBva?noredirect=true'
appkey = 'a57ba9d2c364a49f43f59cb33d96577e'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
# event = 'invoke'
cmpaignid = '1111'
cmpaignid = '111'
# 广告创意ID
ry_adcreative_id = '9876543'
# 广告组ID
......@@ -32,8 +32,8 @@ w = 0
for index in range(1):
#随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '845285910729'
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '845285910729'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '175.93.28.70'
......@@ -78,13 +78,13 @@ for index in range(1):
print('imei:', i)
print('ip', ip)
w = w+1
# time.sleep(8)
# try:
# allEvent().installUpload(i, ip, appkey, cmpaignid)
# except Exception as err:
# print('install_wrong:', w)
# w = w + 1
# print(err)
time.sleep(8)
try:
allEvent().installUpload(i, ip, appkey, cmpaignid)
except Exception as err:
print('install_wrong:', w)
w = w + 1
print(err)
# try:
# allEvent().invoke_test(i, ip, appkey, cmpaignid)
# except Exception as err:
......
......@@ -5,8 +5,8 @@ import random
headers = {'Content-Type': 'application/json'}
URL = 'http://52.80.137.106:8080/receive/tkio/'
# URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://52.80.137.106:8080/receive/tkio/'
URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/'
# URL = 'http://tlog.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/'
......
......@@ -5,21 +5,21 @@ import random
import time
import time
#安卓分包激活
appkey = 'a57ba9d2c364a49f43f59cb33d96577e'
appkey = 'a4dc9f231c68d496bcdd54af12557ad6'
#57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f
# event = 'event_10'
cmpaignid = '1111'
cmpaignid = '111'
for index in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = 'q27dux0c9d5mv9413cp903d07a8q1ipf'
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = 'q27dux0c9d5mv9413cp903d07a8q1ipf'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '143.205.125.236'
# allEvent().installUpload(i, ip, appkey, cmpaignid)
allEvent().installUpload(i, ip, appkey, cmpaignid)
# time.sleep(3)
# allEvent().loginEvent(i, ip, appkey)
# allEvent().orderEvent(i, ip, appkey)
......@@ -27,7 +27,7 @@ for index in range(1):
# num = index + 1
# event = 'event_' + str(num)
# allEvent().ziding_event(i, ip, appkey,event)
allEvent().payEvent(i, ip, appkey)
# allEvent().payEvent(i, ip, appkey)
# allEvent().registerEvent(i, ip, appkey)
# allEvent().invoke_test(i, ip, appkey,cmpaignid)
print(i)
......@@ -170,9 +170,9 @@ def send_request():
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
# url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
# url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000))
......
......@@ -124,6 +124,7 @@ def test_at3():
clickios.parms['ip'] = ip1
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
......@@ -162,13 +163,15 @@ def test_at4():
# 激活的idfa与点击idfa_MD5相同,caid,ip+ua,ip都相同,归因方式为idfa_MD5
def test_at5():
i = idfacode()
i2 = idfacode()
caid = code_nums1(32)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa_MD5'] = computeMD5upper(i)
clickios.parms['idfa'] = ''
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
......@@ -191,7 +194,8 @@ def test_at6():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -214,7 +218,9 @@ def test_at7():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -237,7 +243,9 @@ def test_at8():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -260,7 +268,9 @@ def test_at9():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -284,7 +294,9 @@ def test_at10():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -308,7 +320,9 @@ def test_at11():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -356,7 +370,9 @@ def test_at13():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = computeMD5upper(caid)
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -404,7 +420,9 @@ def test_at15():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = ''
clickios.parms['caid2'] = computeMD5upper(caid2)
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -430,7 +448,9 @@ def test_at16():
clickios.parms['ip'] = ip
clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
......@@ -663,10 +683,11 @@ def test_at26():
clickios.parms[
'ua'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)'
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.data['context']['_caid'] = caid
tkioreceive.data['context'][
......@@ -760,6 +781,7 @@ def test_at29():
# 点击存储
def test_at30():
mget = 'b21d0385ad8371de9e90b3e969a5d0c6:'
i = idfacode()
caid = code_nums1(15)
caid1 = code_nums1(36)
......@@ -772,11 +794,11 @@ def test_at30():
clickios.parms['caid1'] = caid1
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
print("idfa:"+i)
print("idfa_MD5:"+computeMD5upper(i))
print("ip:"+ip1)
print("caid1:"+caid1.upper())
print("caid2:"+caid2.upper())
print("idfa:"+mget+i)
print("idfa_MD5:"+mget+computeMD5upper(i))
print("ip:"+mget+ip1)
print("caid1:"+mget+caid1.upper())
print("caid2:"+mget+caid2.upper())
......@@ -797,3 +819,31 @@ def test_at31():
tkioreceive.send_request()
print(i)
print(ip1)
# 预约归因-在优先级同样的情况下,优先匹配firstclick
def test_firstclick():
i = idfacode()
i2 = idfacode()
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip2 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa_MD5'] = computeMD5upper(i)
clickios.parms['idfa'] = i2
clickios.parms['ip'] = ip2
# clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true')
time.sleep(3)
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
# clickios.send_requestandroid('')
clickios.send_requestandroid2('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.send_request()
print(i)
print(i2)
print(ip1)
print(ip2)
\ No newline at end of file
......@@ -23,6 +23,8 @@ parms = {
# 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
'ip': ip,
'ua': '',
'subchannel': '2000',
# ios
# Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)
# android
......@@ -32,8 +34,8 @@ parms = {
def send_requestandroid(hc):
# url1 = 'http://52.80.137.106:8083/tkio/BRzAnea?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/zaABrya?noredirect=true' + hc
url1 = 'http://52.80.137.106:8083/tkio/mYrAzqa?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/ZFFFVba?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
print(url1)
......@@ -41,7 +43,7 @@ def send_requestandroid(hc):
def send_requestandroid2(hc):
url1 = 'http://52.80.137.106:8083/tkio/Jr63yia?noredirect=true' + hc
url1 = 'http://52.80.137.106:8083/tkio/ZFFFVba?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/yyuyaea?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
......
......@@ -32,10 +32,18 @@ parms = {
def send_requestandroid(hc):
url1 = 'http://52.80.137.106:8083/tkio/AbEjAza?noredirect=true' + hc
url1 = 'http://52.80.137.106:8083/tkio/UvQbUra?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/rEFbiua?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
print(url1)
return response
def send_requestandroid2(hc):
url1 = 'http://52.80.137.106:8083/tkio/ERBbAna?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/rEFbiua?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
print(url1)
return response
\ No newline at end of file
......@@ -8,7 +8,7 @@ import hashlib
data = {
"what": "install",
"appid": "0ecc232109dc25bfedff8aba06271539",
"appid": "b21d0385ad8371de9e90b3e969a5d0c6",
"context": {
"_deviceid": "",
"_idfa": "",
......
......@@ -8,7 +8,7 @@ import hashlib
data = {
"what": "install",
"appid": "f461b1ab7aca6fdf3fa719bf4b6af863",
"appid": "b34100cdf5b586774e5d4dd4357c7b17",
"context": {
"_deviceid": "",
"_imei": "",
......
......@@ -3,11 +3,11 @@ import socket
import struct
import random
import time
appkey = '1cb67e8beb1fe0d5a9c000f6f05b58e5'
appkey = '30a90f0b0cfbde59b206bb046540a17f'
#cid
cid = '21059'
cid = '21029'
#surl
surl = 'nEJ77za'
surl = 'uEBfIna'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(28))
......@@ -17,15 +17,15 @@ for _ in range(1):
#打开
allEvent().openxiaochengxu(i,ip,cid,surl,appkey)
time.sleep(5)
#pv
allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# #离开
# allEvent().hidechengxu(i,ip,cid,surl,appkey)
allEvent().regedchengxu(i,ip,cid,surl,appkey)
# time.sleep(5)
# #pv
# allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# # #离开
# # allEvent().hidechengxu(i,ip,cid,surl,appkey)
# allEvent().regedchengxu(i,ip,cid,surl,appkey)
# # time.sleep(2)
# # allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
# # time.sleep(2)
# allEvent().paymentchengxu(i,ip,cid,surl,appkey)
# time.sleep(2)
# allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
# time.sleep(2)
allEvent().paymentchengxu(i,ip,cid,surl,appkey)
time.sleep(2)
allEvent().eventchengxu(i,ip,cid,surl,appkey)
# allEvent().eventchengxu(i,ip,cid,surl,appkey)
......@@ -5,11 +5,12 @@ import random
headers = {'Content-Type': 'application/json'}
# 测试环境
URL = 'http://52.80.137.106:8080/receive/tkio/event'
# URL = 'http://52.80.137.106:8080/receive/tkio/event'
# 线上环境
# URL = 'http://tlog.trackingio.com/receive/tkio/event'
# URL = 'http://log.trackingio.com/receive/tkio/event'
URL = 'http://log.trackingio.com/receive/tkio/event'
# URL = 'http://jisulog.sortda.com/receive/tkio/event'
# 时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment