Skip to content

Instantly share code, notes, and snippets.

View kmclaugh's full-sized avatar

Kevin McLaughlin kmclaugh

View GitHub Profile
@kmclaugh
kmclaugh / README.md
Last active November 1, 2021 15:29
My Life Jars Datalayer

Below is the code that needs to be added when the user

Submits an email Logins in Signs up The {{variable}} templates need to be filled in with the actual values.

We will also have to add the gtm-container to the https://app-api.mylifejars.com/external/signup app and https://app.mylifejars.com/create-account

@kmclaugh
kmclaugh / corpnet-purchase.js
Created October 28, 2021 16:28
corpnet datalayer
/*
* action: purchase
* description: fire when the user actually completes the purchase
* required fields: actionField.id, actionField.revenue , product.id, product.name, product.quantity, product.price, product.variant (if applicable)
* reference: https://www.simoahava.com/analytics/enhanced-ecommerce-guide-for-google-tag-manager/#purchase
* exmplae url: https://www.corpnet.com/ssl/payment/payment/llc-tx/6fd0e0e40/
*/
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "purchase",
@kmclaugh
kmclaugh / shopify-graphql-orders.http
Created August 23, 2021 16:07
Sample graphql orders query for Shopify
POST https://slideruletech-test.myshopify.com/admin/api/2020-10/graphql.json
Content-Type: application/json
X-Shopify-Access-Token: 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
X-REQUEST-TYPE: GraphQL
query {
orders(first: 10) {
edges {
node {
id
@kmclaugh
kmclaugh / purchase.js
Created August 23, 2021 14:58
Wrapmate Purchases
/*
* action: purchase
* description: fire when the user actually completes the expressway purchase
*/
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "eec.purchase",
customerId: "{{customerId}}", // the customer id if available at purchase
eecEventName: "Purchase",
ecommerce: {
@kmclaugh
kmclaugh / checkout.js
Last active September 8, 2021 15:28
Pressed data layer changes
// just need to add products to the current setup
{
event: "checkoutContactStep | checkoutPaymentStep | checkoutReviewStep",
ecommerce: {
checkout: {
actionField: {
step: "{{checkout.step}}", // 1 // The checkout step (starting at 1).
},
products: [
{
@kmclaugh
kmclaugh / customConversionTracking.html
Created August 17, 2021 17:10
Rezdy Ecommerce Datalayer Push
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-M9FZKB5');</script>
<!-- End Google Tag Manager -->
<script>
window.dataLayer = window.dataLayer || [];
@kmclaugh
kmclaugh / README.md
Last active June 29, 2021 14:04
Ventura Travel

Below is the code that needs to be added when the user

  1. Submits an email
  2. Logins in
  3. Signs up

The {{variable}} templates need to be filled in with the actual values.

Below is the code that needs to be added when the user

  1. Submits a review
@kmclaugh
kmclaugh / README.md
Last active June 9, 2021 15:14
Datalayer Signup and Login

Below is the code that needs to be added when the user

Signs up Logs in

The {{variable}} templates need to be filled in with the actual values.

@kmclaugh
kmclaugh / README.md
Last active May 27, 2021 17:06
fixmycar.io

Below is the code that needs to be added when the user

  1. Signs up
  2. Logs in
  3. Requests a quote
  4. Request a service

The {{variable}} templates need to be filled in with the actual values.