I'm making a trigger which fires on element click (Button) on my Add to cart button , When I click while on GTM Preview mode I cannot see the gtm.click in summary window , I also have clicked all the Click Variables inside Variables tab , what else can I do , or am I missing something?
I inspected the element of the button through firebug
Code:
class="btn-add-to-cart">ADD TO CART
The Trigger fires on
Some Clicks > Click Classes equals btn-add-to-cart
Tag Configuration
Track Type : Event
Label:{(Page URL)}
Advertising:
Enable Display Advertising Features Clicked
If that gtm.clicks tab shows I can inspect the Click Class variable for that and then it might work .
Currently it is not showing.
Did you enable the CLICKS from VARIABLE configuration ? Also make sure Tag is active
Related
i have added a button item to a top ribbontoo my windows form . but it shown like disable (couldn't perform click event) when i run the application.but in the Button properties Enable =true.enter image description here
I'm fairly new to Google Tag Manager and am trying to set up my first custom event.
In my html I have, in the very top of my head:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({"event": "testEvent"});
</script>
And in Google Tag Manager, I've created a trigger that uses my "testEvent":
Additionally, I've created a tag that uses this custom event:
Lastly, when I debug I see that both my custom event and tag show up:
However, when I click on the DOM element that is supposed to trigger that custom event, nothing happens.
I have tried swapping out my custom event trigger for just the built-in click trigger and that works fine, so that tells me that I have my tag itself set up correctly.
Am I missing a step? Is there something more I need to do to make a custom event work? Like I said, I know I could use a regular click trigger in this test case, but in my actual project, I cannot just use the regular click trigger.
Thanks for any help you can offer!
it is a configuration issue. If I understand correctly, you're trying to trigger an event tag when someone clicks on an element with a specific css class.
To achieve this, you will need to:
Go to the "Variables" screen in GTM. On the top portion of the screen, there is the "Built-in Variables" section. Click on the "CONFIGURE" button, a side menu should pop up. Look for the "Click Classes" under the "Clicks" section. Check the checkbox beside "Click Classes", close this menu, should show now see the "Click Classes" variable name under "Built-in Variables".
Go to the "Triggers" screen in GTM. Create a new trigger of the type "All Elements" under the "Click" section. When the configuration for this trigger comes up, select "Some Clicks" under "This trigger fires on". You should see 3 input fields come up for the condition of this trigger. In the first select box, you should see "Click Classes" as one of the available selections, pick that. In the next box, select the appropriate comparison type, we will choose "equals" in this case. In the last input box, put in "search__input" or the name of the css class you want to trigger on.
Go back to the "Tags" screen in GTM. Add this trigger to the tag you want and voila!
If your custom event is pushed only for "search_input" clicks, then you can the modify your trigger to "All Custom Events"
else as #GTMGuy said you need to push the event on "search_input" click event.During event trigger in GTM preview, click on the event and check the value of Variables - "Click element" whether it matches your trigger condition.
You need to add the element clicks using JQuery or any other language, as well as change the trigger to fire on "All Custom Events"
for example say I have a chat button
<script>
var dataLayer = dataLayer || [];
$('.chatBtn').click(function (e) {
dataLayer.push({
'event': 'chat-click'
});
});
</script>
The event should be on that particular element click .
Looking at your custom event it is not attached to any element click
I I'm using Raddatetimepicker to select began and enddate.
When user select two dates then he can click the button called fiter.
I want to show partially(it should appear when page load but in inactive mode) the button before user select the both end and began date. once he selected the both dates i should
show the button as activated.
How can I do it.
Please help me.
get two bool variables which are set false on Startup, set them true on each pick, if both true show button (visible=true or whatever)
just Disable the Filter button on window loads or initially in the Properties of the Filter Button ..use events to enable and disable the Filter button Dont use Visible==false as it may not seen when loads but if you use disabled the button can visible but it can't be clickable and using event you can enbale the filtet button using simple cade as
btnFilter.Enabled=true;
I have a flex application mxml file with 3 tabs.the first tab having the link button to select the value in the 3rd tab.
Suppose, i have a link button in first atab. And the 3rd tab contains the combobox with values:"basic", "advanced". by default the vaule is displaying "default".
Wheni select the linkbutton on the first tab, the "advanced"should be displayed in the comboBox on the 3rd tab.
and the problem is , when click on the first tab link button , at that time the 3rd tab is not initialized.So it is not displaying the "advanced" in the comboBox. selecting the 2nd time on the link button it is displaying fine. But not first time.
code: thirdTab.comboBoxId.selectedItem.data = 1;
Please help me out if need any changes
A tab is initialized when it is activated the first time, so your code should not work.
You can separate data model and bind all the UI controls to the model.
Add an event listener to the 3rd tab that is handled by the parent of the TabNavigator. The handler for that event should be able to get the value from the first tab (which may be stored in the common parent) and return it to the 3rd tab so that the ComboBox there may be correctly set. Listen for the creationComplete event from the 3rd tab.
The dirty way is setting the creationPolicy property of your tab navigator to ContainerCreationPolicy.ALL. This will insure that all the tabs are initialized at once.
The right way is separating the model from the view and using binding as Yuras says.
I created a Button in MXMXL. On button click, I create a Menu as a child of the Button. I am using an XML datasource. The reason for creating it this way, was due to the amount of custom skinning involved. A popupmenubutton was not an option. Anyway, so my question is this: when clicking the button, the menu is displayed. However, if you click the button again, the menu reopens. I want the menu to close if the user clicks the button a second time. Now, I got it to work by setting a var after opening the menu, and then I check that var on each click to make sure that the menu isn't already open. If true, then it will close the menu, instead of reopening it. This works, until the user clicks away, in which the HIDE event gets dispatched and the menu closes. My hack no longer works.
Any suggestions? I spent hours trying different things. The hardest part is trying to destinguish from that second button click when the menu is open, and when the user clicks away from the menu. They both dispatch the HIDE event.
Help!!!
Have you tried adding another eventlistener to the button...FlexMouseEvent.MOUSE_DOWN_OUTSIDE ? You should then be able to set the preventDefault event to true to stop the event from firing anything else and stop the menu from closing.