. Source Data
• The website is made on Tilda.
• Initially, everything was set up only for one country (one subdomain, currency — hryvnia).
• Now we have several language versions (different subdomains), but the tracking code in Google Tag Manager (GTM) and the transmission of the "Purchase" event in Facebook Pixel only work considering the Ukrainian currency (UAH) and are tied to a specific CSS element on the old site.
2. Goal
• Create a universal script in GTM that will work on all subdomains (language versions), correctly determining the purchase amount and currency.
• Transmit this information to Facebook Pixel in the "Purchase" event.
3. Main Tasks
1. Currency:
• Replace the static value "UAH" with a dynamic way of obtaining the currency from the page (through Tilda settings, attribute, variable in the code, etc.).
2. Amount:
• Remove the hard binding to one CSS element, find or create a unified selector (or use Tilda's Data Layer if available) to correctly read the price on all language versions.
3. Set up the tag in GTM:
• In the "Purchase" event, specify dynamic value (amount) and currency.
• Check the trigger to ensure the event fires only on the successful payment page or at the moment of actual purchase.
4. Conduct tests:
• Verify that data is correctly transmitted to Facebook Pixel on each subdomain (each version of the site).
4. Expected Result
• "Purchase" event in Facebook Pixel with the correct amount and currency for all language versions (subdomains).
• A ready GTM container (or a set of changes) that is easily adaptable when adding new countries.
• A short instruction on where and how to set the currency in Tilda and where the price value is taken from in GTM.