This repository provides a script to use the Amplitude Analytics Browser SDK GTM template for cross-domain tracking.
This script allows users to track user activity across different domains seamlessly and provides useful insights for the growth of your business.
-
You are required to create a Custom HTML type tag and copy the code snippet in your GTM.
-
This script is specifically tailored for using the Amplitude Analytics Browser SDK GTM with the default instance.
- If you are using a tag with a custom instance name, please use
amplitudeGTM._iq["your-instance-name"]
. - For Amplitude Analytics Legacy
- You need to enable deviceIdFromUrlParam. Please set
deviceIdFromUrlParam = true
during configuration - You can use
amplitude.getInstance()
oramplitude.getInstance('your-instance-name')
if you have customized instance name. amp_device_id
is designated as the parameter key for deviceId within the URL. Please useamp_device_id
instead ofdeviceId
for legacy GTM template.
- You need to enable deviceIdFromUrlParam. Please set
- If you are using a tag with a custom instance name, please use
This project is licensed under the terms of the MIT license.