This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(events, params) { | |
| const processedHits = events.filter(e => e.vendor === "com.adobe.analytics.hitdebugger") | |
| const allEvarValues = processedHits.map(item => Object.values(item.payload.evars)).flat() | |
| const allPropValues = processedHits.map(item => Object.values(item.payload.props)).flat() | |
| const dataElementSyntaxRE = '^\%.+\%$' | |
| const brokenDataElements = [ | |
| ...allEvarValues, | |
| ...allPropValues | |
| ] | |
| .filter(val => val.match(dataElementSyntaxRE)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var redirect = function(url) { | |
| var params = new URLSearchParams(location.search); | |
| var qls = params.get("qls") || ""; | |
| var adobe_mc_sdid = s.visitor ? s.visitor._supplementalDataIDCurrent : ""; | |
| var adobe_mc_ref = window.location.href; | |
| var now = Date.now().toString().slice(0,10); | |
| var redirect_url = url + "?qls=" + qls + "&adobe_mc_sdid=SDID" + adobe_mc_sdid + "&adobe_mc_ref=" + adobe_mc_ref + "&|MCORGID=5D60123F5245B13E0A490D45@AdobeOrg|TS=" + now; | |
| window.location.replace(redirect_url); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from "react" | |
| import { Link } from "gatsby" | |
| import Datatable from "../components/datatable" | |
| // Fetching data | |
| require("es6-promise").polyfill(); | |
| require("isomorphic-fetch") | |
| const IndexPage = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This variable grabs the query string from the anchors href element (the destination link) | |
| // and makes formats it in order to pass it into URLSearchParams which makes a searchable object of | |
| // the query parameters. Because the rule was triggered by an anchor element, "this" in the custom | |
| // code refers to that anchor element | |
| var qs = "?" + this.href.split("?")[1].split("#")[0] | |
| // Creates an object of key/value pairs out of the query string | |
| // this is the best way to grab the internal_link param | |
| var params = new URLSearchParams(qs); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns true, false, or an object { status: false, events: [uuids] } | |
| * @param {Object[]} events All of the events for the session | |
| * @returns {(boolean|Object)} true, false, or an object that contains a status property | |
| * and optionally an events property that is an array of eventUuids | |
| */ | |
| function (events) { | |
| const analyticsTrackEvents = events.filter(event => event.type === 'AnalyticsTrack'); | |
| let valid = true; | |
| let invalidEvents = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const button = document.querySelector("#convert"); | |
| const outputTextarea = document.querySelector("#outputdata"); | |
| button.addEventListener("click", function() { | |
| let inputData = document.querySelector("#inputdata").value; | |
| // remove newlines | |
| let cleanedData = inputData.replace(/\n/g, ","); | |
| // make it an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import pkgutil | |
| from terminaltables import AsciiTable # type: ignore | |
| from termcolor import colored # type: ignore | |
| from typing import List | |
| rocket:str = u"\U0001F680" | |
| table_data: List[list] = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| import os | |
| import pkgutil | |
| from typing import Dict, List, Optional | |
| from analytics_check.items import ScriptCheckItem | |
| import scrapy # type: ignore | |
| import scrapy_splash # type: ignore | |
| from scrapy.loader import ItemLoader # type: ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Mparticle | |
| * https://docs.mparticle.com/developers/sdk/javascript/getting-started | |
| * | |
| * @class | |
| * @extends BaseProvider | |
| */ | |
| class MparticleProvider extends BaseProvider { | |
| constructor() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import discogs_client | |
| import os | |
| d = discogs_client.Client('John_Python_API_Test/0.1') | |
| if os.path.exists('.env'): | |
| for line in open(".env"): | |
| var = line.strip().split('=') | |
| if len(var) == 2: |
NewerOlder