Pass Event Parameter to JavaScript

  • Diego de Barro Franco e Souza Mello
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 1 month ago - 1 year 1 month ago #156891 by Diego de Barro Franco e Souza Mello
Pass Event Parameter to JavaScript was created by Diego de Barro Franco e Souza Mello
Hello everyone!

I am not a developer and I am in need to implement some google analytics code to the thank you page of Event Booking. To measure events in GA4 and Google Ads Google recommends the use of dataLayer, below is a script sample code.
Code:
[code]window.dataLayer = window.dataLayer || ; dataLayer.push({ 'transactionId': '1234', 'transactionAffiliation': 'Acme Clothing', 'transactionTotal': 38.26, 'transactionTax': 1.29, 'transactionShipping': 5, 'transactionProducts': [{ 'sku': 'DD44', 'name': 'T-Shirt', 'category': 'Apparel', 'price': 11.99, 'quantity': 1 },{ 'sku': 'AA1243544', 'name': 'Socks', 'category': 'Apparel', 'price': 9.99, 'quantity': 2 }] });

[/code]
I need to substitute the script parameters to Event Booking data, like Event Price, Event Name etc...

How can I do it? I mean, I probably need to integrate PHP code and the Java Script, but since I am not a developer I have no idea how to do it. :-D

Please, show me the code and how can I map event booking parameter to the JavaScrip.

Thanks a lot!!!
Last edit: 1 year 1 month ago by Diego de Barro Franco e Souza Mello.

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #156896 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Pass Event Parameter to JavaScript
Hello Diego

Sorry but we could not show write the code for you like that. You would need to find a developer help you to write code. It's not a quick and easy thing, so we could not write the whole code and guide you to integrate it.

There is other approach which you can try. In Events Booking -> there is a config option called Conversion Tracking Code. You can put the code you want there and it will be rendered on thank you page

You can use the following tags in that tracking code and it will be replaced with actual data:

[TOTAL_AMOUNT]
[DISCOUNT_AMOUNT]
[TAX_AMOUNT]
[AMOUNT]
[EVENT_TITLE]
[TRANSACTION_ID]
[ID]
[EVENT_ID]

Try that to see if it works for your need.

BTW, your subscription was expired sometime ago. Please renew your subscription to continue receiving support and update from us

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc