Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Look for patterns in exiting tracking pixel code #850

Closed
7 tasks done
alexfinnarn opened this issue Mar 2, 2017 · 0 comments
Closed
7 tasks done

Look for patterns in exiting tracking pixel code #850

alexfinnarn opened this issue Mar 2, 2017 · 0 comments
Assignees

Comments

@alexfinnarn
Copy link
Contributor

alexfinnarn commented Mar 2, 2017

Context

To allow site owners to enter their own tracking pixels, it would be best if they could generate code to make the tracking pixel. They wouldn't enter the JS, but they would enter key value pairs that would be inserted into JS on runtime.

Expected result

Site owner builds tracking pixel code themselves.

Current result

Whole JS tag has to be inserted into the database by a developer.

Issue outcome

A general pattern that can be used to create tracking pixels or a list of patterns that need developed into options.

Sites to Check

Tracking Pixel Patterns

Doubleclick

<!--
Start of DoubleClick Floodlight Tag: Please do not remove
Activity name of this tag: CU-Boulder FY17 Students Page
URL of the webpage where the tag is expected to be placed: http://www.colorado.edu/students
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 08/29/2016
-->
<script type="text/javascript">
var axel = Math.random() + "";
var a = axel * 10000000000000;
document.write('<iframe src="https://4496471.fls.doubleclick.net/activityi;src=4496471;type=bebou002;cat=cu-bo001;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
</script>
<noscript>
<iframe src="https://4496471.fls.doubleclick.net/activityi;src=4496471;type=bebou002;cat=cu-bo001;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>
<!-- End of DoubleClick Floodlight Tag: Please do not remove -->

Template example

Facebook

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');

fbq('init', '1037280719652233');
fbq('track', "PageView")
fbq('track', 'ViewContent');

</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1037280719652233&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

Template Example

Twitter

<!-- Twitter universal website tag code -->
<script>
!function(e,n,u,a){e.twq||(a=e.twq=function(){a.exe?a.exe.apply(a,arguments):
a.queue.push(arguments);},a.version='1',a.queue=[],t=n.createElement(u),
t.async=!0,t.src='//static.ads-twitter.com/uwt.js',s=n.getElementsByTagName(u)[0],
s.parentNode.insertBefore(t,s))}(window,document,'script');
// Insert Twitter Pixel ID and Standard Event data below
twq('init','nurff');
twq('track','PageView');
</script>
<!-- End Twitter universal website tag code -->

Need template...

<!-- Twitter universal website tag code -->
<script src="//platform.twitter.com/oct.js" type="text/javascript"></script>
<script type="text/javascript">twttr.conversion.trackPid('nurff', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
<noscript>
<img height="1" width="1" style="display:none;" alt="" src="https://analytics.twitter.com/i/adsct?txn_id=nurff&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
<img height="1" width="1" style="display:none;" alt="" src="//t.co/i/adsct?txn_id=nurff&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
</noscript>
<!-- End Twitter universal website tag code -->

...need second template?

Google

<!-- Google Code for Remarketing Tag -->
<!--------------------------------------------------
Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
--------------------------------------------------->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 882382384;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/882382384/?value=0&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

Template example

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant