Professional Documents
Culture Documents
Project Goals:
● To write a custom JavaScript function to track name, price, total value, and
Here is an example of the custom JavaScript function that you can use to track the
name, price, total value, and cross-domain tracking of the car lead or car purchase
event:
var customEvent = {
event_name: eventName,
name: name,
price: price,
total_value: totalValue,
};
ga4ConfigTag.send('event', customEvent);
Once you have created the custom event tag and the custom JavaScript function, you
can trigger the custom event tag when a user clicks on the button or takes another
action that you want to track. You can then create a report in GA4 to view the data from
your custom events.
Project Results: The custom event tag and custom JavaScript function were
successfully created.
The report in GA4 is able to view the data from the custom events.