Skip to content

Instantly share code, notes, and snippets.

View NathanBrownDigital's full-sized avatar
🎯
Focusing

Nathan Brown NathanBrownDigital

🎯
Focusing
View GitHub Profile
@NathanBrownDigital
NathanBrownDigital / mst-engagement
Created April 20, 2020 03:03 — forked from jestrada/mst-engagement
Disco reporting
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Disco report for **May 31st, 2019** – **June 7th, 2019**",
"wrap": true
@NathanBrownDigital
NathanBrownDigital / analytics.js
Last active April 19, 2020 12:59
Analytics.js example event
// On pageview:
analytics.page('Attorney Dashboard');
// On an event (the event in this example would be fired when a new question is sucessfully submitted by a user):
analytics.track('Submit Question', {
practiceArea: 'Traffic',
metro: 'Orlando',
});
// On login
@NathanBrownDigital
NathanBrownDigital / qaPageSchema.html
Last active April 19, 2020 12:55
Schema.org Sample: Q&A Pages
<html>
<head>
<title>How many ounces are there in a pound?</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "QAPage",
"mainEntity": {
"@type": "Question",
"name": "How many ounces are there in a pound?",
@NathanBrownDigital
NathanBrownDigital / 1. wpFormsToDatalyer.js
Last active April 19, 2020 13:04 — forked from kmclaugh/1. wpFormsToDatalyer.js
Notifies the datalyer when a wpForm is submitted so Google Tag Manager can detect it
// This code notifies Google Tag Manager when a wpForm is submitted
document.addEventListener("DOMContentLoaded", function() {
var elementsArray = document.querySelectorAll('[id^="wpforms-form-"]');
elementsArray.forEach(function(elem) {
elem.addEventListener("submit", function(e) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "wpFormSubmit",
wpFormElement: event.target
});
/* User Actions */
// User Login success
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'userLogin',
userID: 'ContactGUID',
loginStatus: 'loggedIn'
});
// User Registration success
/**
* Generates a client ID in the format historically used by the Google Analytics
* JavaScript libraries. Note that any alphanumeric value may be used, but
* ideally each should be unique to a given client.
*
* More information on Client IDs:
* https://developers.google.com/analytics/devguides/collection/protocol/v1/email#client-id-cid
*/
function generateGaClientId() {

Keybase proof

I hereby claim:

  • I am nathanbrowndigital on github.
  • I am nathanbrown (https://keybase.io/nathanbrown) on keybase.
  • I have a public key ASC03XDbJuTyNdaqSoSKApQa35bYU5_JQSfS_-8YEqP8wQo

To claim this, I am signing this object: