Intent ของ com.android.vending.INSTALL_REFERRER ใน Google Play จะเผยแพร่เมื่อ
ติดตั้งแอปจาก Google Play Store แล้ว BroadcastReceiver นี้จะคอยฟังคำสั่งนั้น
ตั้งใจ ส่งผ่านข้อมูลที่มาของการติดตั้งไปยัง GTM สำหรับแอปบนอุปกรณ์เคลื่อนที่และ Google Analytics
<!-- Used for install referrer tracking-->
<service android:name="com.google.tagmanager.InstallReferrerService"/>
<receiver
android:name="com.google.tagmanager.InstallReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
ตัวรับนี้จะเรียกใช้ตัวรับ Google Analytics โดยอัตโนมัติเพื่อตั้งค่า
ข้อมูลแคมเปญ หากใช้ทั้ง Google Analytics SDK และ Google Tag Manager SDK
ต้องเปิดใช้ตัวรับเท่านั้น
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-25 UTC"],[],["The `InstallReferrerReceiver` class listens for the `com.android.vending.INSTALL_REFERRER` intent, which is broadcast upon app installation from the Google Play Store. Upon receiving this intent, it passes install referrer data to Google Tag Manager (GTM) and Google Analytics. To enable, it requires a service and a receiver declaration in the `AndroidManifest.xml`, specifying the intent action. The class features a constructor and an `onReceive` method that processes the received intent. It also sets campaign data for the Google Analytics.\n"]]