Remember me

How to add Google Tag Manager to Gridbox ecommerce

1 year 1 week ago #1

  • Gustavo's Avatar
  • Gustavo
  • Posts: 23
Hello friends

I have spent many hours trying to solve this with no success:
How to add Google Tag Manager to Gridbox ecommerce?
Mainly tags and triggers to buttons like "Add to cart" or "proceed to checkout" or "place order"... But also how to track people who has visited many times the same product page etc

Talking about tracking these buttons, I tried to use this to help: www.balbooa.com/joomla-forms-documentati...anager-and-analytics
But I could not understand how to change Class Suffix of product related buttons...

As you can see, I need some help here
Thanks a lot again

1 year 1 week ago #2

  • Viacheslav's Avatar
  • Viacheslav
  • Posts: 28858
Hello,
Thank you for contacting us!

The principle is the same, the path to the button
.ba-item-add-to-cart .ba-btn-transition

Best Regards,
Vyacheslav, Balbooa Support Team

1 year 2 days ago #3

  • Gustavo's Avatar
  • Gustavo
  • Posts: 23
Hi Vyacheslav and Artem, I hope everything is fine.

Using the path to the button Vyacheslav gave, I could create a tag on Google Tag Manager to track the "add to cart" button. Thank you!

Now, following the same principle I am trying to track everything by looking for classes paths using Chrome F12 Dev tools to inspect classes, and find their path.

However I have been struggling for a couple of days trying to get the username information of logged visitors. So far I could only succesfully fire a tag by creating a new trigger (trigger type: Click - All Elements) (condition to trigger fires on: Some Clicks) (conditions under which this trigger fires: Click Classes ➝ contains ➝ ba-login-btn).
Even being able to fire the tag, I just can't get (find) the infomation provided by the visitor during log in process

This "ba-login-btn" is the class I supposed I should use. Is this right?

But the main question is, how do I get te username infomation? Where is this information "stored" in Gridbox?

Thank you

1 year 2 days ago #4

  • Artem's Avatar
  • Artem
  • Posts: 11342
Hello,
Where is this information "stored" in Gridbox?

In the Joomla db users. Our login uses the default Joomla login system

Regards,
Artem, Balbooa.com

1 year 1 day ago #5

  • Gustavo's Avatar
  • Gustavo
  • Posts: 23
Hi Arteem, thank for the reply

Then, maybe this is not a Gridbox issue, but would you know how do I get this information from the default Joomla login system?

Trying to find this by myself I was told to use this code:

<script>

var loggedInUsername = "<?php echo JFactory::getUser()->username; ?>";

dataLayer.push({
'event': 'usernameLogin',
'username': loggedInUsername

console.log("Nome do usuário logado:", loggedInUsername);
});
</script>

I tried but didn´t work (I could not find the username on the console tab of chrome "Inspect" Dev F12 option)

This leads to a another question: where to include codes like this on Gridbox

Options I found are:
1. Header scripts of site settings / Body scripts of site settings
2. Code editor under Tools option (CSS or Javascript)
3. Custom HTML plugin (used only on pages where it is included) (HTML or CSS)

Is the code wrong?
If not, where should I include it between the 3 options above?
Is there a complete diferent solution to get this information from the default Joomla login system?

Thanks

1 year 23 hours ago #6

  • Gustavo's Avatar
  • Gustavo
  • Posts: 23
Hi guys, hope you are fine

Any ideas on topic?
tks

1 year 2 hours ago #7

  • Artem's Avatar
  • Artem
  • Posts: 11342
Gustavo,

This code is not correct, it doesn't work.
Entered value from field username (Gridbox plugin login) can get by name

document.getElementsByName("username")[0].value

but what do you need to get finally?

Regards,
Artem, Balbooa.com

11 months 4 weeks ago #8

  • Gustavo's Avatar
  • Gustavo
  • Posts: 23
Hi Artem,

what I need is to get the username of logged visitors. Ideally on the frontend (if not possible, then from the backend joomla)

Then send this information to GTM and GA4 to track navigation behaviour mainly on products pages of Gridbox ecommerce.

Thanks. That will help me a lot
Powered by Kunena Forum