Posts

Enable Google Analytics Ecommerce Reports

Image
The purpose of e-commerce purchase reports in Google Analytics is to provide businesses with valuable insights into their online sales performance and customer behavior. These reports help businesses understand how customers interact with their website, which products are selling well, and how effective their marketing efforts are in driving sales. For more details,  Ecommerce in Google Analytics Go to your  Google Analytics account  →  Reports  →  Monetization  →  E-commerce purchases . Here're some snapshots

Set Up Google Analytics 4 for eCommerce Tracking

Image
Recently, there was a requirement to enable eCommerce Tracking for our B2B Sites to collect information about the shopping behavior of our users visiting sites. Some of them are -  Purchase Tracking Abadnbodn Cart Items added to the Shopping Cart Removing Items from the Shopping Cart Checkout Process Here are some of the links to start with and make sure you already have Google Analytics and E-commerce Configurations completed Make sure you've  added the Google Analytics: GA4 Configuration tag to your website  and can access Analytics and the website source code. Measure ecommerce events with the GA4 Event tag List of Recommended events Please make sure to add the Gtag script in the Head Markup e:g: Add Items to the Shopping Cart -  Add a script in LWC to create the following payload and delegate an event you can use  Tag Assistant Companion  to review the data in real-time. Enable Google Analytics Ecommerce Reports

Migrate Community Users Between Licenses

Here are some of the links to help you with your License transformation process. You can move community users between certain licenses using Data Loader Mass change User License Type Experience Cloud Licenses Eligible for Upgrades - Help And Training Community Migrate Community Users Between Licenses ( https://help.salesforce.com/articleView?id=networks_migrate_users_between_licenses.htm&type=5 ). Upgrade Community User Licenses ( Help And Training Community ).  Mass disable portal users with Data Loader - https://help.salesforce.com/s/articleView?id=000386423&type=1

The significance of a git commit message

Image
A well-written commit message serves as documentation for the changes made in a commit. It provides context and clarity to both current and future developers about the purpose, scope, and impact of the changes. Documentation : Well-written commit messages provide context, clarity, and documentation for the changes made, benefiting current and future developers. Communication : Commit messages to facilitate communication among team members. They allow developers to understand the intent behind each change and collaborate more effectively. Clear and descriptive commit messages help maintain a shared understanding of the codebase. Code Review : During code review, commit messages to help reviewers understand the changes without needing to examine the actual code diff immediately. This allows reviewers to focus on higher-level aspects of the change, such as design decisions and implementation strategies. Troubleshooting and Debugging : In the event of issues or bugs, commit messages provid...

Salesforce Multi Domain Auto Login SSO

Salesforce Multi Domain Auto Login SSO We had a use case where multiple Authentication Providers were configured for a single B2B Site. With more than one Authentication Provider option, the User has to go through the Salesforce Login Screen to choose the correct SSO to initiate the login process. However, the ask is to automate the process based on UserType/Domains or replace the Standard login page with a custom login page. Salesforce has an AuthConfiguration Class to retrieve authentication provider credentials for users to log in to a Salesforce org. Request String startUrl = '/home'; String communityUrl = 'https://xxxx.sandbox.my.site.com/Source/'; String samlId = '0LExxxxxxxxx'; // String ssoUrl = Auth.AuthConfiguration.getSamlSsoUrl(communityUrl, startUrl, samlId);  // this will generate a link based on the SSO ID. System.debug ('ssoUrl ' + ssoUrl); here, we can use http/href redirect with ssoUrl. Response https://xxxxx.sandbox.my.site.com/Source/...

Making an HTTP callout after rolling back DML Operations

You can now make an HTTP callout after rolling back DML operations by releasing savepoints with Database.releaseSavepoint. The introduction of the Database.releaseSavepoint method in Salesforce Apex is a significant development because traditionally, once you rolled back a transaction to a savepoint, you couldn't make any future DML operations or callouts in that transaction. This limitation poses a challenge in complex transactional scenarios where you may need to perform a callout after a conditional rollback. Here's an example of how Database.releaseSavepoint can be used: Savepoint sp = Database.setSavepoint(); try  {  // Perform DML operations  Account a = new Account(Name='Test');  insert a; // ... some logic that may fail } catch (Exception ex) {  // Exception handling if needed  Database.rollback(sp);  Database.releaseSavepoint(sp); // Also releases any savepoints created after 'sp' // Since savepoint is released, you can now make a callout Ht...

Randomly Generated Universally Unique Identifier (UUID)

Salesforce is a platform that keeps improving by introducing new features, and one such feature is the ability to generate UUIDs in Apex, which was introduced in the Spring 24 Release. With this new functionality, developers can create unique identifiers for records and objects within their Salesforce organization without needing external libraries or custom code. This feature allows developers to save time and effort while ensuring the uniqueness of identifiers UUID Class and Usage The UUID Class offers various methods to perform operations like generating a version 4 universally unique identifier (UUID), comparing UUIDs, and converting UUID instances to a string. The generation of UUID is done using a cryptographically strong pseudo-random number generator, and the UUID is represented as 32 hexadecimal values. Here's a brief overview of each method: equals(obj): Compares a UUID instance with the specified object. fromString(str): String representation of a UUID to a UUID instance...