jared 4 bulan lalu
induk
melakukan
0c17418857
1 mengubah file dengan 15 tambahan dan 0 penghapusan
  1. 15 0
      deployment/selwire_click.py

+ 15 - 0
deployment/selwire_click.py

@@ -21,6 +21,10 @@ import os
 import zipfile
 from seleniumwire import webdriver
 import requests
+from ga4mp import GtagMP
+from ga4mp import FirebaseMP
+from ga4mp.store import DictStore
+import os
 
 #from selenium import webdriver
 
@@ -29,6 +33,13 @@ PROXY_USER = 'choozmo' # username
 PROXY_PASS = 'Chuz83102968' # password
 
 
+ups=str(os.urandom(5).hex()).upper()[0:5]
+print(ups)
+gtag_tracker = FirebaseMP(api_secret='HoQdcKyKS9SQsjIyphWKQA', firebase_app_id='1:589953727312:android:6923bc306ae616a1da8a55', app_instance_id="8F1C7C2C9A004DECAF27DB6AEFF"+ups)
+purchase_event = gtag_tracker.create_new_event(name="seo_click")
+
+
+
 custname=None
 
 param=sys.argv[1]
@@ -130,6 +141,10 @@ def selenium_jared_click():
     #    print(txt)
     #    print(href)
         if domain in href:
+            purchase_event.set_event_param(name="query", value=kw)
+            event_list = [purchase_event]
+            gtag_tracker.send(events=event_list)
+
             webdriver.ActionChains(driver).move_to_element(elmt).perform()
             webdriver.ActionChains(driver).move_to_element(elmt).click().perform()
             print(domain)