Skip to content

Instantly share code, notes, and snippets.

ga('ecommerce:addItem', {
'id': '1234',
'name': 'Fluffy Pink Bunnies',
'sku': 'DD23444',
'category': 'Party Toys',
'price': '11.99',
'quantity': '5'
});
Countly.q.push(['track_pageview']);
ga('send', 'pageview');
Countly.q.push(['add_event', {
"key":"play",
"count":1,
"segmentation":{
"category":"videos",
"label":"Fall Campaign"
}
}]);
ga('send', 'event', 'Videos', 'play', 'Fall Campaign');
@frknbasaran
frknbasaran / gainitialize.html
Created November 5, 2018 13:15
Google Analytics Integration
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
// add this line into your google analytics snippet
CountlyGAAdapter();
ga('create', 'UA-XXXXXXXX-3', 'auto');
@frknbasaran
frknbasaran / CountlyGAWrapper.html
Last active October 5, 2018 14:43
Send your data to Countly with GA methods.
<!DOCTYPE html>
<html>
<body>
<!-- Countly Web SDK Initialization -->
<script type="text/javascript">
// Some default pre init
var Countly = {};
Countly.q = Countly.q || [];
// Provide your app key that you retrieved from Countly dashboard
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
/* React */
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
Dimensions,
TextInput,
var MongoClient = require('mongodb').MongoClient;
// Connection URL
var url = 'mongodb://localhost:27017/myproject';
// Use connect method to connect to the Server
MongoClient.connect(url, function(err, db) {
console.log("Connected correctly to server");
db.createCollection("gevsek");