Exclude Page from being tracked in Omniture - analytics

Is there a way to remove single page from being tracked in Omniture(Site Catalyst). I want to track all pages instead of only one page. I don't want to send request to Omniture if that page has been hit.
Is there a way to update script for that?
Thanks

Yes, there is a way. If you click the cog next to the Adobe Analytics Tool on the Overview page in DTM you'll be taken to a settings page. The tab on the bottom titled Customize Page Code, this will run before your adobe beacon would normally be sent. Simply put your logic to select the correct page and then return false and your tracking beacon wont fire.
if (location.pathname =='whatever') {
return false;
}
**If you don't have any idea what you're doing codewise, be careful. There is a lot of breakage and data loss that can occur if users put bad code here.
If you're unfamiliar with javascript, I would suggest seeking out a little help. If you want to give it a shot but you're unsure of your code, I would suggest navigating to the page that you want to remove, opening the console (F12), and typing location.pathname. This will give you the exact string to test again so your code should be:
if (location.pathname == 'whatever/string/the/location/pathname/gave/you') {
return false;
}
Make sure you don't forget the quotes. Good luck!

Related

Sanity/next slug- 404 not found

When I try to access my slug page, the name of the slug shows in the browser search bar (so I know its accessing the backend data), but nothing shows up on the page. In the console, error 404 keeps coming every 3 seconds.
Due to lack of timing, experience, knowledge, etc., I've had to switch from react to next very last minute (learning both for the first time at the moment). In react, I remember you could establish a path/page that went '/pageName/:slug', but I haven't seen that for next. I think this might be what is causing the issue, that I don't have an equivalent of that, but I'm not sure how to go about doing that. How do I fix this issue?
I'm happy to post any code if needed.
Got it. I hadn't given much context in the post, but I had two .js page files, gallery.js (where I can select a set), and sets.js where I wanted the slug to route into. So my link in gallery.js looked like this: <a href="./sets/[slug]">.
The fix: I renamed sets.js to [slug].js, and removed /sets/ so that it was just <a href="./[slug]">.

I am adding the code in weebly but it dosent show up

Issue with JSON LD CODE
To start with I am trying to use this code in weebly, buy using embed code option and then I click on the edit custom HTML and enter this code. However, after entering this nothing shows up as in the recipe is not shown on the page and a blank page is shown.
this code is picked on schema.org, for recipes.
Could anyone please help me out in what exactly went wrong. I really appreciate your assistance. FYI- I am new to this. I am trying to set up my own food website and and wanted to schema to for SEO improvement. Any other suggestions are welcome. Thanks in advance.
Please refer this link for the JSON-LD CODE. IT WILL BE AT THE END OF THE PAGE. https://schema.org/Recipe
When you add a JSON-LD block in the HTML, it doesn’t change anything visibly on the page. The script element is hidden by default in all browsers, and you typically want to keep it like that (users typically have no interest in your JSON-LD code).
To check if adding the JSON-LD worked correctly, open the page in a browser and check the source code of the page. You should see the script element with your JSON-LD.
You have to add the content (that should be visible to your users) regularly with HTML. The JSON-LD exists next to your content (duplicating the data like name, photo URL etc.), it doesn’t replace your content.

Reload Grid in ATK4

I'm trying to learn enough to create a website that lets people answer quiz questions using Agile Toolkit 4.2.
I have a page that displays one question and its answer choices from the 'sampleq' model. I want to make a button that displays the next record in the model.
I've tried a bunch of different ways to get the js()->reload() command to work properly, but I haven't been able to do it. I get AJAX "unexpected identifier" error. I've been through the related questions on this site and looked for documentation on the ATK site, but I haven't found an example that works for me.
Can anybody tell me how to get the button to properly reload the grid?
function init(){
parent::init();
$page=$this;
}
function page_qlisting() {
$qid=$this->recall('value',1);
echo $qid;
$NextB=$this->add('Button')->SetLabel('Next Question '.$qid);
$grid=$this->add('Grid');
$grid->setModel('sampleq',array('question','A1','A2','A3'));
$grid->dq->where('id=',$qid);
if($NextB->isClicked()){
//$this->memorize('value',$qid+1);
$grid->js()->reload();
}
}
function page_qentry() {
$this->api->auth->check();
$this->add('Html')->set('Welcome to the question entry page.<br>');
$this->add('CRUD')->setModel('sampleq');
}
}
Edit:
After reading Romans' answer, I first tried this:
$qid=$this->recall('value',1);
$grid=$this->add('Grid');
$grid->setModel('sampleq',array('id','question','A1','A2','A3'));
$grid->dq->where('id=',$qid);
$this->add('Button')->SetLabel('Next Question')->js('click', $this->memorize('value',$qid+1))->js('click', $grid->js()->reload());
That actually works - it displays only one record at a time, and it displays the next one when I click the button. Next I tried adding a "Previous" button like so:
$qid=$this->recall('value',1);
$grid=$this->add('Grid');
$grid->setModel('sampleq',array('id','question','A1','A2','A3'));
$grid->dq->where('id=',$qid);
$this->add('Button')->SetLabel('Previous Question')->js('click', $this->memorize('value',$qid-1))->js('click', $grid->js()->reload());
$this->add('Button')->SetLabel('Next Question ')->js('click', $this->memorize('value',$qid+1))->js('click', $grid->js()->reload());
This doesn't work, though. Both buttons are decrementing. I tried laying it out like your adjuster buttons example here. Here's what my increment button code looks like in that attempt:
$incr=$this->add('Button')->SetLabel('Next Question');
if($incr->isClicked()){
$this->memorize('value',$qid+1);
$grid->js()->reload();
}
In that case, I get "Error in AJAXec response: SyntaxError: Unexpected identifier" when I click the button.
Can you offer any advice on how to make increment and decrement work with a grid (or crud)? Why doesn't the adjuster example work when you try to refresh a grid instead of refreshing the button? Thanks for the previous answer, and thanks in advance for any additional guidance that you may have time to offer.
This should be it:
$this->add('Button')->js('click', $grid->js()->reload());
If you use CRUD you might want to reload CRUD instead.

Override standard buttons in salesforce service cloud console

Is it possible to override the standard 'Create new ' button and 'detail' link in the list view of service cloud console?
I want to show my custom VF pages on click of these buttons/links.(if yes how?)
In addition, any examples to the service cloud API toolkit would be helpful.
Thanks in advance.
Best would be to create separate set of buttons as it's less redirects...
If you want to really override standard ones I think you'll have to use normal overrides (on all buttons) but with content based on Javascript you'd be deciding what should happen.
http://www.salesforce.com/us/developer/docs/api_console/index.htm - Console JS API will be handy.
Make a visualforce page that uses standardController="Your_Object__c". In the content include a reference to the Console API and code similar to this example of isInConsole():
<apex:includeScript value="/support/console/27.0/integration.js"/>
<script type="text/javascript">
function testIsInConsole() {
if (sforce.console.isInConsole()) {
alert("in console");
} else {
alert("not in console");
}
}
</script>
Except you'll be redirecting either to your special pages or to standard "new" and "edit". To force going to original edit mode you can add nooverride=1 parameter in the URL (which is also mentioned in the documentation of URLFOR function).
Normal "new Account" (results in override if specified): /001/e
Force go to your page: /apex/NewAccount
Force go to standard page: /001/e?nooverride=1
So now you have an idea how to detect whether you're in console or not and where to go. Only remaining question is "which window should redirect". Because Console is built on frames you might get different results on using javascript window, location, parent etc. objects. That's a general knowledge how to work with frames in JS so I'm not going to write that up. But I'll include a link to srcUp() function provided by salesforce that you might want to reuse.
I think it's defined only in Console context to be honest so maybe you could ditch the whole isInConsole in favor of typeof srcUp != 'undefined'?
Good luck :)

Style Drupal 7 log-in page (with hook_prepare/hook_preprocess)

Despite a previous solution to my own question, I'm not completely satisfied. I now have three exactly the same pages (page.tpl.php, page--user.tpl.php and page--user--login.tpl.php) with only a slight difference in the last page. So if I have to edit a single div for some reason, I have to change it in all three pages.
So I'm looking for a more solid solution (it will probably be in the template.tpl-file with a hook_prepare/hook_preprocess. But I have no idea how to do this... Can anyone provide me with some hints or info?
It is not the better solution for me but you can use the arg() function in your page.tpl.php like this :
if (arg(0) == 'user') {
// Do something
if (arg(1) == 'login') {
// Do something else
}
}
Depending on your needs you may also customize your pages using only CSS rules as body tag carry some usefull classes.

Resources