Just wanted some advice as it’s my first time creating a custom event in Hubspot - we want to capture email/phone clicks on our website and use this in our reports. The event is firing but wanted to check if you foresee any issues with this JS code?
This is the JS in hubspot:
Hey @LK8 ,
The JavaScript code you’ve provided for tracking email clicks in HubSpot looks good overall. However, here are a few suggestions to ensure it works smoothly: 1. Ensure that the variables (clickURL, clickText, pageTitle, pagePath) passed to the sendToHubSpot function in GTM ({{Click URL}}, {{Click Text}}, {{DLV - Page title}}, {{Page Path}}) are correctly formatted and match the expected data types in HubSpot. 2. Ensure that the event name (pe43976934_email_clicks) and property names (click_url, click_text, pageTitle, pagePath) match exactly between your GTM script and HubSpot setup 3. Always test it out with some demo content to make sure that the data is flowing as expected.
Do let me know if you are facing any issues while testing.