in2wp

  • Home
  • Tips
  • How to
  • Save
  • Themes
  • Contact

Code 4

Code

Google Analytics 4 (GA4) for WordPress Site Kit

4 years ago Code, How to, Tips, Tutorials, Using WordPressAnalytics, GA4, Google, property, Site Kit, Track, Upgrade
Google Analytics 4 (GA4) for WordPress Site Kit

As you already know a new version of Google Analytics was introduced in October 2020 that requires the usage of a Google Analytics 4 (GA4) property to track unified web and app analytics. More details on the differences between GA4 and Universal Analytics (UA) are available here.

This article will guide you the ways to upgrade your existing Universal Analytics (UA) to GA4 via the Site Kit WordPress plugin.

Beginning with version 1.36, released on July 7, 2021, Site Kit is adding the ability for users to create and add a GA4 property directly through the Site Kit interface.

Add a Google Analytics 4 property (to a site that already has Analytics)

Steps to set up a Google Analytics 4 property alongside your existing Universal Analytics property

Add a Google Analytics 4 property  - Upgrade to GA4

Click GA4 Setup Assistant (instructions below) to create a Google Analytics 4 property that collects data alongside your existing Universal Analytics property. Your Universal Analytics property is left unchanged and continues to collect data — you can always access it via the property selector or Admin screen.

If you use a website builder or CMS-hosted website (for example, WordPress, Shopify, Wix, etc), use your website builder’s/CMS’s custom HTML feature to tag your site. Follow these instructions. Do not simply paste your “G-” or “UA-” ID into the field that your CMS provides.

Follow all the Steps here

Important : https://sitekit.withgoogle.com/documentation/ga4-analytics-property/

Jetpack Publicize for share your site’s custom posts on social media

4 years ago Code, How to, Tips, TricksCustom Post Types, Functions, Jetpack, Publicize, Share, Social Media

By default, Jetpack’s Publicize is only triggered when you publish a new post. You can, however, extend this to other Custom Post Types. You have 2 options to add Publicize Support to a Custom Post Type:

  1. You can add Publicize support to an existing post type thanks to the add_post_type_support() function. To do so, add the following code to a functionality plugin or directly modifying the theme’s functions.php file. (carefully)

add_action(‘init’, ‘my_custom_init’);
function my_custom_init() {
add_post_type_support( ‘product’, ‘publicize’ );
}

You’ll need to replace “product” with your Custom Post Type name.

2. You can add Publicize support when registering the post type:

// Register Custom Post Type
function custom_post_type() {

$labels = array(
‘name’ => _x( ‘Products’, ‘Post Type General Name’, ‘text_domain’ ),
);
$args = array(
‘label’ => __( ‘product’, ‘text_domain’ ),
‘supports’ => array( ‘title’, ‘editor’, ‘publicize’, ‘wpcom-markdown’ ),
);
register_post_type( ‘product’, $args );

}
// Hook into the ‘init’ action
add_action( ‘init’, ‘custom_post_type’, 0 );

Find Your Site’s Hidden .htaccess File in cPanel

5 years ago Code, How to, TipscPanel, htaccess
Find hidden htaccess file in cPanel 2

“Where is my .htaccess file?”

1. Access cPanel’s File Manager

2. Select Domain folder and click “Settings”
Find hidden htaccess file in cPanel 1

3. Select “Show Hidden Files (dotfiles)” Find hidden htaccess file in cPanel 2

How to Disable WordPress Post Revisions

5 years ago Code, How to, Tips

Open wp-config.php located in your WordPress root directory and add the following code:

define('AUTOSAVE_INTERVAL', 300 ); // seconds
define('WP_POST_REVISIONS', false );

This code will disable all future revisions to be saved and it will also increase your autosave interval from 60 seconds to 300 seconds, so it means your post will be autosaving every 5 minute instead of every minute.

Protect your visitors with SSL, from $3.44

Most viewed
root directory on Bitnami (WordPress) on Amazon LightSail
Root directory (htdocs) location – AWS LightSail (Bitnami & WordPress)
1,847 views
Cannot open the disk 'Windows7.vmdk' or one of the snapshot disks it depends on Module 'Disk' power on failed
How to fix “Module ‘disk’ power on failed” VMware
1,098 views
Wave-Video-Maker-Lifetime-plan-Animatron
Wave.video Lifetime Deal
1,042 views

About

in2wp

Start & Keep Growing with WP!

Guide you to quickly take your business online with WordPress and go beyond the usual online marketing actions.

This content uses referral links, which means in2wp may be compensated in exchange for your clicking on links posted on this website. Read our disclosure policy for more info.

  • in2wp
  • Contact in2wp
  • Terms of Service
  • Privacy Policy
2018 © in2wp.com | It all starts with a simple d̵r̵e̵a̵m̵ WordPress website !