Conversion tracking
Cross-domain conversion tracking
Due to the restrictions introduced, tracking conversions of unique users only works within one domain by default. However, as the owner of several domains, e.g. amplink.io and app.amplink.io, you are able to pass tracking parameters between domains.
There are two params that you can pass from one domain to another:
amp_vid - Visitor Unique ID - it's a UUID string saved in browser local storage. It's used to identify conversion entries for unique visitor
amp_llt_id - Last Link Target ID - it's a UUID string saved in browser local storage. It identifies the last link that redirected the visitor to your website. In that way you can check which links created by you gives best conversion rate.
We have prepared 2 methods that will allow you to download these parameters and pass them on.
AmplinkConversion.getVisitorUniqueId();
and
AmplinkConversion.getLastLinkTargetId();
You can use it to prepare redirection link from your domainA to domainB.
const visitorUniqueId = await AmplinkConversion.getVisitorUniqueId();
const redirectUrl = `https://yourdomain.com/any-path?amp_vid=${visitorUniqueId}&_llt_id=${AmplinkConversion.getLastLinkTargetId()}`;
By default Amplink will bind any conversion event you tracked with last redirection link. This will let you track multiple conversion points for one redirection.
If you to track 1 conversion per 1 redirection you can clear last redirection source from storage. You can do it by adding:
AmplinkConversion.clearLastLinkTargetIdFromStorage();