Git Product home page Git Product logo

emailtrack's Introduction

emailTrack.php

A class to generate Google Analytics tracking pixels 1 for html email and "view email in the browser" pages.

This class can be used in html static generators or programs to generate tracking pixels.

It can also be used to send information directly from php to Google Analytics, for example when a transactional email is sent to a user.

How to use

The file demo.php contains some examples on how to use the class to generate pixels.

The file demo2.php contains an example where the request is sent from a php script.

Inside the ./snippets/ folder there's also example code.

Configure to add data to your Google Analytics account / propriety

1 - Modify $GAtrackingID in emailTrack.php to your Google Analytics tracking ID. In the example: UA-7467053-1

public $GAtrackingID = 'UA-7467053-1';

2 - Define the field to retrieve the user id from Engaging Networks (or other email sending providers that have similar features). In the example bellow the user ID field is cp_supporter_id

public $supporterID = '{user_data~cp_supporter_id}';

Important: Google forbids using any data that allows them to identify a user, including email, phone number or name. Please check their policies for more information.

Note: At the moment it’s not possible to use the field Supporter ID. As a temporary hack I’ve made a copy named cp_supporter_id. Unlike Supporter ID, cp_supporter_id is not automatically populated in new records. I believe this issue will be fixed in the next 3 months.

emailtrack's People

Contributors

osvik avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.