If I create a dataLayer vairable in GTM to capture a dynamic value, the event pixel (part of CM floodlight) needs to be placed on site, correct? - tags

I am implementing Campaign Manager floodlight tags in Google Tag Manager. As I am trying to capture dynamic values, do I create a dataLayer variable with double brackets, ex: {{cost}} in GTM, then request the event pixel be placed on site? Will the gloabl snippet have to be implemented on site too, or no since the GTM container is linked to DV360?

Ok, you should really clarify things, but I'll try crystal-balling it.
In order for you to capture dynamic variables in dataLayer, you first need to make sure the variable has been pushed into it (typically by the front-end team or a plugin).
To use a dataLayer variable, you create a corresponding Data Layer Variable in GTM. See the screenshot:
When you deploy a pixel and you need to use eye color in it using javascript, you get the value by referencing the name of the GTM variable rather than what's in DL: {{DLV - Eye Color}}
Finally, timing. When your pixel firing trigger is being triggered, your dynamic values should already be available. Otherwise, you'll not be getting them, sending pixels with no dynamic values.

Related

Is there a way to permanently add a box displaying points of students in the navbar

So I am working on a project that awards points to students for submitting assignments or participating in forums, these points are then exposed as an Http resource using Flask.
The points are calculated by looking at the events triggered for each student.
One of the requirements right now is to add a box next to the student's name that shows the total amount of points they have. I have two ways of accessing the points, either by an http request from moodle or by storing and retrieving the points from moodle's database.
My question is what is the best approach of creating this "box", I have tried using moodle blocks and hacking the code but nothing seems to be working. Is creating a plugin for this the only solution or is there a simpler way to do it (if it is even possible)?
To answer your question properly you should have provided at least the theme and the Moodle version you work with. Should this box be displayed everywhere? Is the score calculated for every course individually?
Two proposals that came into my mind:
You could create a custom plugin of type block. There you can display the score of the user of the session and the top ten for example (If the score is calculated for each course individually). A disadvantage is that every teacher of a course could remove that block easily, if he or she wants to.
If the score counts system-wide you could put that box at the start page of your Moodle website, where only people with higher rights will be able to remove it.
If you use boost you could display the score in the navbar right next to the users name. For that you will have to create a new child theme of boost and overwrite navbar.mustache of theme_boost which get's it's information from columns2.php because it's included into columns2.mustache. In this PHP file you can include your logic and display it with the HTML which you put into navbar.mustache.
Of course these are not really simple ways to do that. But at the moment I doubt that an easy solution exists for this problem.

Trigger a plugin step on "entityimage" change

I created a plugin that should upload the contact entity "entityimage" to an external storage.
The code itself should works (it works as a console app), but I am unable to add a step that trigger on "entityimage" change as I can't find it in the filtering attribute list in the Plugin Registration Tool.
Is there a way to trigger this plugin only when "entityimage" change?
Regards,
Dremor
Reviewing the Contact's entityimage field in the Metadata Browser indicates that it is a "Virtual" field, which may be why it is unavailable as a filtering attribute.
Also, according to the SDK there does not appear to be any other message available besides "Update" on the Contact that could be used to indicate that the entityimage has changed.
And, changing the image through the UI does create an Audit History entry, however, it is a generic "Update" entry, with the old value and new value blank.
It appears that triggering a plugin on change of only the entityimage field is not possible, nor do there appear to be any OOB hooks to see if that field has changed.
The only other think I can think to research is Change Tracking. Otherwise it looks like you may have to upload the image on any Update of a Contact.
Or, you could sync the image URL's from CRM to an external system and compare the one in CRM to the external system before uploading.
Strangely enough, if you don't set any filtering attributes the plugin does get triggerd when changing the image, but i guess this also means that all field changes will trigger it.

Facebook Custom Story Map Attachment

I can't for the life of me get my custom story display in the Map layout. I have done this before but that solution is no longer working either so I'm starting to think something has changed.
Current Setup
I have a custom object type Track with a self-hosted object here (please see the source code for object structure). This object has a required field called route which contains multiple GeoPoints. I will put the GeoPoints in another file at some point but that causes other problems at the moment.
I have a custom action called Ski that obviously has the field Track which references the object.
In my custom story which is Ski a Track, I have edited the attachment to be a map layout and set the Route to be track.route.
Now when I create an action which references my self-hosted object using the Graph API Explorer I get an ID back which means its been created. I can also see the story on my timeline.
The Issue
The story is always in the standard layout.
My Question
Is it possible to still use the map attachment. If so what am I doing wrong?
UPDATE
For those interested I have submitted a bug report here. For anyone also experiencing issues of this nature then please subscribe to it as Facebook may deem it important enough to sort out.

SugarCRM fetching data from outside REST service to subpanel

I'm trying to create subpanel in Account detail view where list of elements is fetched from external REST service.
I know how to define subpanel, but have no idea how to fill it with data from external network source. Was trying to use get_subpanel_data but there I can only change SQL.
Any ideas how can I do this?
When I've done this in the the past, at least with Sugar 6, I opted distinctly not to try to create a true subpanel. The data being loaded is coming from an outside source and is loaded dynamically with the page, so why present it as if it's static data coming from Sugar? Instead, I created a custom Smarty template to use as the footer on the detail page. For such an example, you can check how it works on the Calls Edit View. I think it's the footerTpl parameter in the detailviewdefs.php or editviewdefs.php. I loaded the smarty template by creating a custom detail view for my module, so custom/modules/MyModule/views/view.detail.php - extend the base Detail View class and override the display to feed Smarty new params, then your Smarty template only needs to iterate through and present the data that your view defined.
To be super-hip and abide by MVC, you could even put your custom code into your bean (if it's a custom module) or into a custom controller method, then reference that from the view.detail.php, and still feed it from there to the Smarty template.
Alternatively, you could just load JavaScript into the Smarty template and use the JavaScript to call the third-party service, parse and present it, etc.
I realize this question is a little bit old now however it comes up fairly often so why not provide an answer with a couple possible solutions. I won't get into code but more just into the design theory of how it can work. If someone needs more specific code help then that is another question.
A couple ideas...
As you mentioned you can define a custom Function which will load in Data to the SubPanel from your own SQL Query. That is one method that I just recently got to finally put to use after knowing about it for a good year and a half.
When you go this route, you are restrained to using the Columns in the SubPanel. I assume it is using the actual Metadata files to determine which Field Columns a SubPanel can use so you pretty much need your custom data in a Database table to have the same column names as the fields defined in the SubPanel Metadata.
Obviously this works great in the right situation, however not always and that leads us into the 2nd method I know of.
The other way is pretty much what #Mattew-Poer mentioned in his answer. It means abandoning the SubPanel altogether and instead generating your own HTML. This is by far my favorite and prefered way of doing it and I have been some really custom modules due to this being possible in a custom module! I will show an example below.
(Click HERE to View full size image)
In the screenshot, you can see in this example that I have something looking Similar to a SubPanel however it is not and is much for flexible and easy to customize.
Example, to the far left column in my fake subpanel is image checkboxes. When clicked on, an AJAX request is made to change the Task row Status.
After that, the checkbox image is updated to indicate the new Status state, the Modified DateTime is updated, the Status column has color background SPANS and is also updated with the correct text and background color when the left side checkbox is clicked.
Doing any of this with the standard SubPanels is a complete nightmare and would be difficult to do some of the stuff that you are open to do when you build your own version of a SubPanel.
With that said, I have built an identical clone of the above screenshot using SugarCRM default SubPanels! It was a nightmare. I could easily update the content and HTML in some of the columns. I even had the AJAX click checkbox image to update and do all the other updates I mentioned above. It wasn't too hard and worked fairly good but it had some issues.
When you do inline edit, inline create record, or subpanel paging to load different set of record. You would then lose all the custom HTML formatting that was applied. The reason is, in the SubPanel you are limited to using the After UI load logic hook. So since the "Page" is loaded already, when an AJAX request is made to add/edit the subpanel content or load a new set of items with the paging links. It only loads the SubPanel content on those events and the whole Page content does not reload. Because the logic hook only fires off 1 time after the page loads, this newly loaded subpanel data doe not receive any of your custom HTML formatting.
In my case, this means that nice looking colored background Status spans are lost, the image checkboxes are lost, and some other functionality is lost.
Now to get super technical, I could have gone another 3rd route and instead made new Custom Field Types for each SubPanel filed that I needed to apply custom HTML to. This process is super hard in my experience and in some cases it really isn't the BEST solution.
Because of the reason explained, this is why my new modules use the Custom HTML route to generate my own version of a custom subpanel or whatever Data is needed in my Module pages! So far it is working better than I imagined and has opened doors for me to build custom SugarCRM modules that I previously didn't even realize would be possible to build due to some of the issues I mentioned above. Now I bypass them altogether and open the door to do pretty much anything!
I've got some really cool stuff for SugarCRM in the works right now. If anyone has any questions feel free to ask in a new question or for me personally in a comment here.

How does GWT "know" which DOM element you've just selected?

It has been a while since I've touched GWT, but I was recently looking at GWT applications to see how they accomplished certain tasks. I noticed that if you go into AdWords (a GWT application), you can manipulate table information in-line. For example, if I go into my campaign and click the pencil icon next to the ad group, a little popup will appear allowing me to change the ad group's name ... except there's no identifying information anywhere in the DOM structure. No hidden fields, no id's snuck into the div elements.
What's going on here? I've been working with interactive tables, but I've always established a click handler on a class and stuck an ID in there so I can tell what I'm editing. I've always found this as unsatisfactory. Any ideas?
It uses a JavaScript variable to get a hold on the element directly when it's created. That variable can then be stored somewhere - as long as it's accessible directly or indirectly from the the global object (document), it can be retrieved later from there.
A simple pure JavaScript example would be:
document.myParagraph = document.createElement('p');
document.body.appendChild(myParagraph);
document.mySpan = document.createElement('span');
document.myParagraph.appendChild(mySpan);
...
document.mySpan.onclick = ...