Jump to content

Need a method to fire an iframe pixel within PHP script


n1concepts
Go to solution Solved by n1concepts,

Recommended Posts

Hi,

 

Does anyone have a solution or have had to implement a PHP setup where you fire iframe pixels from your script based on conversions from an external page.

FYI: the script where the iframe code will be loaded is not rendered by a viewer - it's a secured php script within the application that pulls the select iframe from database and print to screen within a loop/array.

 

For example:

External link: http://domain1.com/index.php?leadid=123

 

Where: $leadid is the tracking value to know where lead originated from to load correct pixel

 

 

$c=track1       // this is conversion value assigned that will fire on iframe pixel (below)

iframe pixel for #123: <iFrame scr="http://www.domain.com/pixel.php?p=$c" ></iFrame>

 

Therefore, the snippet of code would look like:

<?php

$c = track1;           // this is the value that will identify the campaign where conversion assigned

$pixel = " <iFrame scr="http://www.domain.com/pixel.php?p=";              // building the iframe pixel
$pixel .= "$c\" ></iFrame>";                                                                       // appending variable $c and completing the iframe

if ($_GET[leadid] == 123) {
echo pixel;                                                                                                // fire or pring the iframe to the php page

?>

Note: the domain (URL) is not real - just used to demo the setup.

 

Now, here's the issue: that snippet of code will work if I load to php page via traditional web browser methods (calling in Firefor, IE, etc...)

However, that's not how the setup is defined:

 

Setup:

1. external offer will fire the pixel back to me (say at site: http://tracking.com) and once I have their return data - via $_GET function (pulling values from url),

I then implement the above code to alert the specified publish who is awarded the lead. This is where the problem arise....

 

Issue: b/c the application receives hundreds (at a minimum) per hundred, there is no simple way to load each individual iframe - in the php page and render it - so it fires correctly.

Note: I've already tried creating a loop to parse the database - that captures the data and via sql query, I can fire each (loading them individually).

Problem: that query parses through each so fast (within seconds), there is not enough time for any one set of pixels to fire the select iframe.

-----------

 

This is where I need some feedback on how to accomplish this to support objective from an application perspective - having to load multiple pixels (each different based on where lead data logged to database).

 

Again, how can I successfully load each iframe (as they logged to database) to fire, being there is no 'public' page being viewed?

There's only the php script processing the lead and parsing the iframe - echoing it but only showing for less than one second.

 

I know there's a solution but just having pin pointed it yet....

Link to comment
Share on other sites

What I'm asking to understand is, 'is there a way to create and load a 'temp' php page that house that select iframe code'?

I know this possible to create a file, etc.. but wanting to know if there is a more efficient way to handle this operation b/c that will then create thousands of pages (hourly) which is a waste of disk space.

 

Hopefully, I've given enough details to provide a visual for a true response - I know some will give 'corky' answers (no worries) but looking for some creditable input (thx!)

Link to comment
Share on other sites

I don't fully understand your question, but it seems like there should be an easier way to do this. Could you be more specific as to the flow of the requests to and from your server. Where in that flow is the issue?

 

Are you trying to parse content from an HTTP request?

Link to comment
Share on other sites

  • Solution

Hi,

 

There is - no need to create 'repeative' files, etc...

The answer lies in this link: http://php.net/manua...ction.flush.php

 

baically, I just need to pass code (the iframe) to the buffer in apache and give an 1/2 sec to display then resume script - looping through rest of array.

Problem solved and it works - thx!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.