How do I send a file_download event to google analytics?

Google Analytics considers a file download a link to one of their supported file types. But my single page app generates files on the fly and then generates a hyperlink with base64 data and prompts the user to download it. I want to capture that event as a Conversion as far as analytics is concerned. After my file download code, I’m sending

gtag('event', 'file_download', {'send-to':'downloads'}); 

I see the event being posted in the console and google reports a 204 No Content status back, so everything is working at the network level. But I am not seeing any events listed under Events > events or Engagement > events or even Dashboard > top events. What could be going wrong?

WooCommerce mini cart fragments click event

I’m trying to add click event to the WooCommerce cart icon. However it doesn’t work I guess because of the WooCommerce Ajax fragments. I want to keep Ajax fragments active and just add click event on the icon.

PHP:

if ( ! function_exists( 'arendelle_woo_cart_icon' ) ) {     function arendelle_woo_cart_icon() {          if ( ! arendelle_is_woocommerce_activated() ) {             return;         }          $  count = WC()->cart->get_cart_contents_count();         ?>          <div class="arendelle-menu-cart woocommerce">             <a class="arendelle-menu-cart__url arendelle-offcanvas-js-trigger" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php echo esc_attr__( 'View my shopping cart', 'arendelle' ); ?>">                 <span class="arendelle-menu-cart__icon-holder">                     <i class="arendelle-icon-cart arendelle-menu-cart__icon"></i>                     <?php if ( 0 < $  count ) : ?>                         <span class="arendelle-menu-cart__count"><?php echo esc_html( $  count ); ?></span>                     <?php endif; ?>                 </span>             </a>              <?php if ( 0 < $  count ) {                 echo '<div class="arendelle-offcanvas">';                     echo '<div class="arendelle-offcanvas__panel">';                         woocommerce_mini_cart();                     echo '</div>';                     echo '<div class="arendelle-offcanvas__overlay elementor-clickable"></div>';                 echo '</div>';             } ?>         </div>         <?php      } } 

JS

    cartOffcanvas: function() {         let trigger = document.querySelector('.arendelle-offcanvas-js-trigger');         let panel = document.querySelector('.arendelle-offcanvas__panel');         let overlay = document.querySelector('.arendelle-offcanvas__overlay');           console.log(trigger);          trigger.addEventListener('click', function(e) {             e.preventDefault();             e.stopImmediatePropagation();              console.log('clicked');             panel.classList.add('arendelle-offcanvas__panel--is-open');                  });      }, 

Orientation changed event in Unity3D?

I’d like to listen to orientation change events, so for example my UI layout or the components themselves can be changed.

All I’ve found is that I should check the value of Screen.orientation every frame, and check if it has changed since previous frame.

But this isn’t really efficient, and I wonder why doesn’t Unity provide an event for this.

This asset seems to have what I need. Anyone knows how is it implemented?

As a last resort I could make a singleton behaviour which starts a coroutine which checks every X seconds whether it has changed, and if it has, I fire an event. But this still seems like a suboptimal solution.

How do I hide the event description within template of The Events Calenar using Ultimate Member shortcode?

OK, so the goal is to hide the event description with Ultimate Member shortcode [um_loggedin].

I tried doing echo do_shortcode but it’s not working…

This is the code I used within wp-content/themes/hello-elementor/tribe-events/single-event.php:

<?php echo do_shortcode('[um_loggedout]'."Sorry, but only loggedin users are allowed to access the details".'[/um_loggedout]');?>

<?php echo do_shortcode('[um_loggedin]'.the_content().'[/um_loggedin]');?>

Is it legal to use the APIs of Meetup.com, Eventbrite etc, to aggregate their event data into one place, similar to Google?

I have a predicament. I’m trying to build a platform that will basically be a place where all events, online/offline, are listed.

Initially – my platform will obviously have zero events, because nobody knows about it. And for anyone to use it – there needs to be events on there – classic chicken and egg scenario.

My thought was to aggregate events on to my platform (and link to their source), whilst also allowing users to create events on MY platform. Eventually, I’d be able to not bother listing events from other sources if mine gains enough traction. So, I am definitely competing with these sites.

Google is pulling data from many different events sources, and displaying it on their pages like so – https://www.google.com/search?q=events+in+london+meetup&rlz=1C5CHFA_enUA720GB740&oq=events+&aqs=chrome.0.69i59l3j69i60l3j69i65l2.4289j1j9&sourceid=chrome&ie=UTF-8&ibp=htl;events&rciv=evn&sa=X&ved=2ahUKEwiYtuPx2bLuAhU3REEAHaRkCZ0Q5rwDKAJ6BAgNEA4&sxsrf=ALeKk03Uj9jeI8lTj0__V-UWcgcv_pdFew:1611427139353#htivrt=events&htidocid=L2F1dGhvcml0eS9ob3Jpem9uL2NsdXN0ZXJlZF9ldmVudC8yMDIxLTAyLTAzfDE2ODA2NzEwNzgyNjAxNDg4MTQ2&fpstate=tldetail

The difference is, Google, I assume (?), is probably scraping the data rather than using APIs.

In the Meetup API Terms, it states:-

"Not use the Meetup API for any commercial purpose without the express written consent of Meetup;

Not undermine our commercial interests or make unreasonable commercial uses of the Meetup API, such as by substantially replicating our Platform or significant aspects of the Platform, to be determined in Meetup’s sole discretion;

While you may charge for any application you develop (subject to Meetup’s consent), you may not sell, lease, or sublicense the Meetup API;"

I know aggregating is a bit of a legal grey area but I wanted to ask for opinions on whether or not this would be legal, and if not – how the hell do I get any traction and users without having any content?

Note: This is in the UK.

Adding Facebook Pixel Event results in error

I’m trying to create a Facebook Pixel Event, however I get an error on my site, every time I try to add it. The error states: "Request could not be processed: We could not process your request. Please try again." on the page where I want to add the pixel.

The error appears on my website on the subpage where I want to add the event. It’s a Facebook Event Manager error, as it seems. This is what it looks like on my page (it’s in German though) enter image description here

My website is a WordPress website and I added the Pixel via Google Tag Manager. The pixel itself seems to be working fine.

I googled a lot but didn’t find anything related to this. The Facebook Pixel Helper Chrome plugin shows that the Pixel is correctly installed and working. When I look at the Chrome developer console I see this error however: "Error: Invalid data".

What could be causing this problem? There is literally NO INFORMATION on this kind of error on the web, so I’m really helpless here.

I cleared all caches, tried using other browsers that I never use but that didn’t help either. The weird thing is, it did work only 1 hour ago and now it suddenly stopped working.

Getting meta in editor plugin, and event triggering issue

I have a Custom Post Type defined with custom-fields support. I then registered a meta field.

The first issue is that select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles always returns undefined on first call (before being updated by dispatch( 'core/editor' ).editPost). Also, when I save the Custom post Type the value isn’t modified in the database.

The other issue is, when check any of the checkboxes, on first click, isChecked() is properly called, on next clicks it doesn’t happen, but updateMeta() is triggered. If I fold/unfold the control or uncheck a checkbox, all the checkboxes do get updated by calling isChecked():

animation example of second issue

Here is my code:

class Metaboxes extends Base {      /**      * Setup user.      */     public function setup() {         add_action('init', [$  this, 'init'] );     }      public function init () {         register_post_meta(             'vaenc_actu',             '_vaenc_actu_roles_scope_roles',             [                 'show_in_rest' => true,                 'single'       => true,                 'type'         => 'array',                 'default'       => [],                 'auth_callback' => function() {                     return current_user_can( 'edit_posts' );                 }             ]         );     } } 

My javascript is like so:

const {registerPlugin}                              = wp.plugins; const {PluginDocumentSettingPanel}                  = wp.editPost; const {PanelBody, CheckboxControl}                  = wp.components; const {useSelect, select, withSelect, withDispatch} = wp.data; const {Fragment, useState}                          = wp.element; const {__}                                          = wp.i18n; const {compose}                                     = wp.compose;  const RolesControl = ( {isChecked, updateMeta} ) => {     return (         <>             <Fragment intialOpen={true}>                 <CheckboxControl                     label={__( "PRI", "vae" )}                     checked={isChecked( 'vae-pri' )}                     onChange={( value ) => updateMeta( 'vae-pri', value )}                 />                 <CheckboxControl                     label={__( "PRC", "vae" )}                     checked={isChecked( 'vae-prc' )}                     onChange={( value ) => updateMeta( 'vae-prc', value )}                 />                 <CheckboxControl                     label={__( "Certificateurs", "vae" )}                     checked={isChecked( 'vae-certif' )}                     onChange={( value ) => updateMeta( 'vae-certif', value )}                 />             </Fragment>         </>     ) }  const RolesField = compose( [     withSelect( () => {         return {             actu_scope_meta: select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles,         };     } ),     withDispatch( ( dispatch ) => ({         isChecked ( prop ) {             let meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles;             if ( meta ) {                 return meta.includes( prop );             }             return false         },         updateMeta ( prop, value ) {             let meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles;             if ( !meta ) meta = []              if ( meta.includes( prop ) && !value ) {                 meta = meta.filter( arrayItem => arrayItem !== prop );             } else if ( !meta.includes( prop ) ) {                 meta.push( prop );             }              dispatch( 'core/editor' ).editPost( {meta: {_vaenc_actu_roles_scope_roles: meta}} );         },     }) ), ] )( RolesControl );  const Render = () => {     const postType = useSelect( select => select( 'core/editor' ).getCurrentPostType() );     if ( 'vaenc_actu' !== postType ) {         return null;     }      return (         <>             <PluginDocumentSettingPanel                 name="vae-role-scope-sidebar"                 title={__( 'Restrictions', 'vae' )}             >                 <RolesField/>             </PluginDocumentSettingPanel>         </>     ) }  registerPlugin( 'vae-role-scope-sidebar', {     render: Render } )  

MySQL event scheduler waiting on empty queue since server restarted 12 days ago

I noticed a process on the server which has been running for more than 12 days, which I think coincides with the last time MySQL was restarted.

mysql> SHOW FULL PROCESSLIST;  +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ | Id      | User            | Host      | db   | Command | Time    | State                  | Info                  | +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ |       5 | event_scheduler | localhost | NULL | Daemon  | 1098372 | Waiting on empty queue | NULL                  | | 1774483 | root            | localhost | NULL | Query   |       0 | starting               | SHOW FULL PROCESSLIST | +---------+-----------------+-----------+------+---------+---------+------------------------+-----------------------+ 2 rows in set (0.00 sec) 

There are no events, and I haven’t attempted to created any.

mysql> SELECT * FROM information_schema.EVENTS;  Empty set (0.00 sec) 

This is actively using up to 8% of my server’s CPU.

Is there a way of determining what this is, or why it was started? Will this try to run every time I restart MySQL? If so, what is it ‘waiting’ for and do I need to tweak my configuration at all to prevent this?

MySQL 8.0.21

Conditionally enqueue a stylesheet based off of a javascript click event

I would like to use a different ccs file based on a javascript click event. The user will have a choice of color themes by clicking one of the colored buttons on the screen. I originally have it working by providing the linked css with an id that can be targeted with javascript. The link is in the HTML head tag of course. In WordPress though we enqueue the css file in the functions.php file and so I am not sure how to give the css file an ID to target it with the javascript. If anyone can help me out or point me in the right direction I will really appreciate it. I am open to all possibilities and I thank you all in advance. if you need me to elaborate more feel free to let me know.

facebook customer chat for website – button click event help need

Dear friends, I need a help. I am facing a problem;

I have setup facebook customerchat in my site. It appear at the bottom-right corner of the page. When clicked on the green round button it open.

View attachment 255988
# I wish to add another option on it, so that I can also open this chat clicking another button/ image/ text also. Suppose see the attchment, if I click on "Chat with us" or the female face image, it will open the customer chat same way.

Optional:
Also can I add…

facebook customer chat for website – button click event help need