Skip to content

Instantly share code, notes, and snippets.

@philcon93
philcon93 / 1.md
Created September 18, 2018 22:59
Bootstrap 4 hover menu

Bootstrap 4 hover menu

Simple, CSS only solution:

.dropdown:hover>.dropdown-menu {
  display: block;
}
@philcon93
philcon93 / 1.md
Last active June 5, 2018 02:20
Google analytics script update

Migrate from analytics.js to gtag.js

analytics.js uses trackers to send data to Google Analytics and hit types to specify the types of the data.

Unlike analytics.js, gtag.js doesn't use trackers to send data to Google Analytics. It sends data to Google Analytics properties identified by their tracking IDs set by the config command. The event names supplied to gtag.js specify the types of data being sent to Google Analytics.

Page Header

<!-- Global site tag (gtag.js) - Google Analytics -->

SASS Mapping

SASS

Maps represent an association between keys and values, where keys are used to look up values. They make it easy to collect values into named groups and access those groups dynamically. They have no direct parallel in CSS, although they're syntactically similar to media query expressions.

@philcon93
philcon93 / 1.md
Last active March 8, 2018 07:23
GA add/remove from cart functions

GA enhanced eCommerce

Similar to my FB Pixel functions, this will setup the product data and send to Google Analytics, measuring an Addition or Removal from Cart.

Please note, to reduce the size of the analytics.js library, enhanced ecommerce tracking is not provided in the default library. Instead it is provided as a plugin module that must be loaded before being used.

To load the enhanced ecommerce plugin, use the following command:

ga('require', 'ec');

@philcon93
philcon93 / 1.md
Last active March 8, 2018 04:16
FB Pixel addtocart functions

FB Pixel addtocart event

Suppose you have an e-commerce website and your "Add to Cart" button does not navigate to a new page. You may want to activate an event when the button is clicked.

In this example, we will activate a ViewContent standard event on page load.

When someone clicks "Add to Cart" button, we will activate an AddToCart standard event.

@philcon93
philcon93 / 1.md
Last active February 27, 2018 01:58
Git patch file

Git patch file

  1. Pull latest from relevant branch
  2. Make branch off relevant branch
  3. Make change & commit
  4. Run this command: git format-patch RELEVANT_BRANCH -1 HEAD --stdout > NAME_OF_YOUR_PATCH.patch

It will create a .patch file which you can then just send to devs or put on confluence.

@philcon93
philcon93 / 1.md
Created February 15, 2018 02:03
Dynamic converter for Neto

Dynamic converter

How to current setup script:

In Neto Cpanel

  • Create Third party script 'Dynamic converter',
  • Add Account ID as Key 1,
  • Paste 'Installation String' in page footer, replacing Account ID with [@REFERRAL_KEY1@],
@philcon93
philcon93 / 1.md
Last active January 23, 2018 01:27
importing and exporting in JS

Import/Export

JS

To export a single component in ES6, you can use export default as follows:

class MyClass extends Component {
 ...
@philcon93
philcon93 / 1.md
Last active January 2, 2018 05:06
How to Git

Contribute to Skeletal

Have you found an issue on Skeletal but don't know exactly how to fix it? Raise an issue:

Do you know a fix for a current Skeletal issue? Do you have an enhancement to Skeletal?

  • Make a Pull Request with your new code:
@philcon93
philcon93 / 1.md
Last active November 30, 2017 22:53

Google Analytics Goals

  • If you don't have one already, then register for a Google account.
  • Using your Google account, register for Google Analytics.
  • Add your Neto site to your Google Analytics account.
  • Set up Google Analytics to work with your Neto site.
  • Click the Goals tab.
  • Add a Goal Name, such as Checkout Abandonment.
  • Add a Goal Type of, Destination.
  • Add a Goal URL, /invoice.html